home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-ietf-bgp-bgp4-05.txt < prev    next >
Text File  |  1993-06-07  |  130KB  |  3,189 lines

  1.  
  2.  
  3.  
  4.  
  5. Network Working Group                                      Y. Rekhter
  6. INTERNET DRAFT                 T.J. Watson Research Center, IBM Corp.
  7.                                                                  T.Li
  8.                                                         cisco Systems
  9.                                                               Editors
  10.                                                            April 1993
  11.  
  12.  
  13.                   A Border Gateway Protocol 4 (BGP-4)
  14.  
  15.  
  16. Status of this Memo
  17.  
  18.    This document, together with its companion document, "Application of
  19.    the Border Gateway Protocol in the Internet", define an inter-
  20.    autonomous system routing protocol for the Internet. 
  21.  
  22.    This document is an Internet Draft. Internet Drafts are working
  23.    documents of the Internet Engineering Task Force (IETF), its Areas,
  24.    and its Working Groups. Note that other groups may also distribute
  25.    working documents as Internet Drafts.
  26.  
  27.    Internet Drafts are draft documents valid for a maximum of six
  28.    months. Internet Drafts may be updated, replaced, or obsoleted by
  29.    other documents at any time. It is not appropriate to use Internet
  30.    Drafts as reference material or to cite them other than as a "working
  31.    draft" or "work in progress".
  32.  
  33.  
  34. 1. Acknowledgements
  35.  
  36.    This document was originally published as RFC 1267 in October 1991,
  37.    jointly authored by Kirk Lougheed (cisco Systems) and Yakov Rekhter
  38.    (IBM).
  39.  
  40.    We would like to express our thanks to Guy Almes (Rice University),
  41.    Len Bosack (cisco Systems), and Jeffrey C. Honig (Cornell University)
  42.    for their contributions to the earlier version of this document.
  43.  
  44.    We like to explicitly thank Bob Braden (ISI) for the review of the
  45.    earlier version of this document as well as his constructive and
  46.    valuable comments.
  47.  
  48.  
  49.  
  50.  
  51. Expiration Date October 1993                                    [Page 1]
  52.  
  53. INTERNET DRAFT                                                April 1993
  54.  
  55.  
  56.    We would also like to thank Bob Hinden, Director for Routing of the
  57.    Internet Engineering Steering Group, and the team of reviewers he
  58.    assembled to review earlier versions of this document.  This team,
  59.    consisting of Deborah Estrin, Milo Medin, John Moy, Radia Perlman,
  60.    Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted with a
  61.    strong combination of toughness, professionalism, and courtesy.
  62.  
  63.    This updated version of the document is the product of the IETF BGP
  64.    Working Group with Yakov Rekhter and Tony Li as editors. Certain
  65.    sections of the document borrowed heavily from IDRP [7], which is the
  66.    OSI counterpart of BGP. For this credit should be given to the ANSI
  67.    X3S3.3 group chaired by Lyman Chapin (BBN) and to Charles Kunzinger
  68.    (IBM Corp.) who is the IDRP editor within that group.  We would also
  69.    like to thank Mike Craren (Proteon, Inc.), Dimitry Haskin (BBN) and
  70.    Dennis Ferguson (University of Toronto) for their insightful
  71.    comments.
  72.  
  73.  
  74. 2.  Introduction
  75.  
  76.    The Border Gateway Protocol (BGP) is an inter-Autonomous System
  77.    routing protocol.  It is built on experience gained with EGP as
  78.    defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as
  79.    described in RFC 1092 [2] and RFC 1093 [3].
  80.  
  81.    The primary function of a BGP speaking system is to exchange network
  82.    reachability information with other BGP systems.  This network
  83.    reachability information includes information on the list of
  84.    Autonomous Systems (ASs) that reachability information traverses.
  85.    This information is sufficient to construct a graph of AS
  86.    connectivity from which routing loops may be pruned and some policy
  87.    decisions at the AS level may be enforced.
  88.  
  89.    BGP-4 provides a new set of mechanisms for supporting classless
  90.    interdomain routing.  These mechanisms include support for
  91.    advertising an IP prefix and eliminates the concept of network
  92.    "class" within BGP.  BGP-4 also introduces mechanisms which allow
  93.    aggregation of routes, including aggregation of AS paths.  These
  94.    changes provide support for the proposed supernetting scheme [8].
  95.  
  96.    To characterize the set of policy decisions that can be enforced
  97.    using BGP, one must focus on the rule that a BGP speaker  advertise
  98.    to its peer in neighbor ASs only those routes that it itself uses.
  99.    This rule reflects the "hop-by-hop" routing paradigm generally used
  100.    throughout the current Internet.  Note that some policies cannot be
  101.    supported by the "hop-by-hop" routing paradigm and thus require
  102.    techniques such as source routing to enforce.  For example, BGP does
  103.    not enable one AS to send traffic to a neighboring AS intending that
  104.  
  105.  
  106.  
  107. Expiration Date October 1993                                    [Page 2]
  108.  
  109. INTERNET DRAFT                                                April 1993
  110.  
  111.  
  112.    the traffic take a different route from that taken by traffic
  113.    originating in the neighboring AS.  On the other hand, BGP can
  114.    support any policy conforming to the "hop-by-hop" routing paradigm.
  115.    Since the current Internet uses only the "hop-by-hop" routing
  116.    paradigm and since BGP can support any policy that conforms to that
  117.    paradigm, BGP is highly applicable as an inter-AS routing protocol
  118.    for the current Internet.
  119.  
  120.    A more complete discussion of what policies can and cannot be
  121.    enforced with BGP is outside the scope of this document (but refer to
  122.    the companion document discussing BGP usage [5]).
  123.  
  124.    BGP runs over a reliable transport protocol.  This eliminates the
  125.    need to implement explicit update fragmentation, retransmission,
  126.    acknowledgement, and sequencing.  Any authentication scheme used by
  127.    the transport protocol may be used in addition to BGP's own
  128.    authentication mechanisms.  The error notification mechanism used in
  129.    BGP assumes that the transport protocol supports a "graceful" close,
  130.    i.e., that all outstanding data will be delivered before the
  131.    connection is closed.
  132.  
  133.    BGP uses TCP [4] as its transport protocol.  TCP meets BGP's
  134.    transport requirements and is present in virtually all commercial
  135.    routers and hosts.  In the following descriptions the phrase
  136.    "transport protocol connection" can be understood to refer to a TCP
  137.    connection.  BGP uses TCP port 179 for establishing its connections.
  138.  
  139.    This memo uses the term `Autonomous System' (AS) throughout.  The
  140.    classic definition of an Autonomous System is a set of routers under
  141.    a single technical administration, using an interior gateway protocol
  142.    and common metrics to route packets within the AS, and using an
  143.    exterior gateway protocol to route packets to other ASs.  Since this
  144.    classic definition was developed, it has become common for a single
  145.    AS to use several interior gateway protocols and sometimes several
  146.    sets of metrics within an AS.  The use of the term Autonomous System
  147.    here stresses the fact that, even when multiple IGPs and metrics are
  148.    used, the administration of an AS appears to other ASs to have a
  149.    single coherent interior routing plan and presents a consistent
  150.    picture of what networks are reachable through it.
  151.  
  152.    The planned use of BGP in the Internet environment, including such
  153.    issues as topology, the interaction between BGP and IGPs, and the
  154.    enforcement of routing policy rules is presented in a companion
  155.    document [5].  This document is the first of a series of documents
  156.    planned to explore various aspects of BGP application.  Please send
  157.    comments to the BGP mailing list (iwg@ans.net).
  158.  
  159.  
  160.  
  161.  
  162.  
  163. Expiration Date October 1993                                    [Page 3]
  164.  
  165. INTERNET DRAFT                                                April 1993
  166.  
  167.  
  168. 3.  Summary of Operation
  169.  
  170.    Two systems form a transport protocol connection between one another.
  171.    They exchange messages to open and confirm the connection parameters.
  172.    The initial data flow is the entire BGP routing table.  Incremental
  173.    updates are sent as the routing tables change.  BGP does not require
  174.    periodic refresh of the entire BGP routing table.  Therefore, a BGP
  175.    speaker must retain the current version of the entire BGP routing
  176.    tables of all of its peers for the duration of the connection.
  177.    KeepAlive messages are sent periodically to ensure the liveness of
  178.    the connection.  Notification messages are sent in response to errors
  179.    or special conditions.  If a connection encounters an error
  180.    condition, a notification message is sent and the connection is
  181.    closed.
  182.  
  183.    The hosts executing the Border Gateway Protocol need not be routers.
  184.    A non-routing host could exchange routing information with routers
  185.    via EGP or even an interior routing protocol.  That non-routing host
  186.    could then use BGP to exchange routing information with a border
  187.    router in another Autonomous System.  The implications and
  188.    applications of this architecture are for further study.
  189.  
  190.    If a particular AS has multiple BGP speakers and is providing transit
  191.    service for other ASs, then care must be taken to ensure a consistent
  192.    view of routing within the AS.  A consistent view of the interior
  193.    routes of the AS is provided by the interior routing protocol.  A
  194.    consistent view of the routes exterior to the AS can be provided by
  195.    having all BGP speakers within the AS maintain direct BGP connections
  196.    with each other.  Using a common set of policies, the BGP speakers
  197.    arrive at an agreement as to which border routers will serve as
  198.    exit/entry points for particular networks outside the AS.  This
  199.    information is communicated to the AS's internal routers, possibly
  200.    via the interior routing protocol.  Care must be taken to ensure that
  201.    the interior routers have all been updated with transit information
  202.    before the BGP speakers announce to other ASs that transit service is
  203.    being provided.
  204.  
  205.    Connections between BGP speakers of different ASs are referred to as
  206.    "external" links.  BGP connections between BGP speakers within the
  207.    same AS are referred to as "internal" links.
  208.  
  209. 3.1 Routes: Advertisement and Storage
  210.  
  211.    For purposes of this protocol a route is defined as a unit of
  212.    information that pairs a destination with the attributes of a path to
  213.    that destination:
  214.  
  215.       - Routes are advertised between a pair of BGP speakers in UPDATE
  216.  
  217.  
  218.  
  219. Expiration Date October 1993                                    [Page 4]
  220.  
  221. INTERNET DRAFT                                                April 1993
  222.  
  223.  
  224.       messages: the destination is the systems whose IP addresses are
  225.       reported in the Network Layer Reachability Information (NLRI)
  226.       field, and the the path is the information reported in the path
  227.       attributes fields of the same UPDATE message.
  228.  
  229.  
  230.       - Routes are stored in the Routing Information Bases (RIBs):
  231.       namely, the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes
  232.       that will be advertised to other BGP speakers must be present in
  233.       the Adj-RIB-Out; routes that will be used by the local BGP speaker
  234.       must be present in the Loc-RIB, and the next hop for each of these
  235.       routes must be present in the local BGP speaker's forwarding
  236.       information base; and routes that are received from other BGP
  237.       speakers are present in the Adj-RIBs-In.
  238.  
  239.  
  240.    If a BGP speaker chooses to advertise the route, it may add to or
  241.    modify the path attributes of the route before advertising it to
  242.    adjacent BGP speaker.
  243.  
  244.    BGP provides mechanisms by which a BGP speaker can inform its
  245.    neighbor that a previously advertised route is no longer available
  246.    for use.  There are three methods by which a given BGP speaker can
  247.    indicate that a route has been withdrawn from service:
  248.  
  249.  
  250.       a) the IP prefix that expresses destinations for a previously
  251.       advertised route can be advertised in the WITHDRAWN ROUTES field
  252.       in the UPDATE message, thus marking the associated route as being
  253.       no longer available for use
  254.  
  255.       b) a replacement route with the same Network Layer Reachability
  256.       Information can be advertised, or
  257.  
  258.       c) the BGP speaker - BGP speaker connection can be closed, which
  259.       implicitly removes from service all routes which the pair of
  260.       speakers had advertised to each other.
  261.  
  262.  
  263. 3.2 Routing Information Bases
  264.  
  265.    The Routing Information Base (RIB) within a BGP speaker consists of
  266.    three distinct parts:
  267.  
  268.       a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has
  269.       been learned from inbound UPDATE messages. Their contents
  270.       represent routes that are available as an input to the Decision
  271.       Process.
  272.  
  273.  
  274.  
  275. Expiration Date October 1993                                    [Page 5]
  276.  
  277. INTERNET DRAFT                                                April 1993
  278.  
  279.  
  280.       b) Loc-RIB: The Loc-RIB contains the local routing information
  281.       that the BGP speaker has selected by applying its local policies
  282.       to the routing information contained in its Adj-RIBs-In.
  283.  
  284.       c) Adj-RIBs-Out: The Adj-RIBs-Out store the information that the
  285.       local BGP speaker has selected for advertisement to its neighbors.
  286.       The routing information stored in the Adj-RIBs-Out will be carried
  287.       in the local BGP speaker's UPDATE messages and advertised to its
  288.       neighbor BGP speakers.
  289.  
  290.  
  291.    In summary, the Adj-RIBs-In contain unprocessed routing information
  292.    that has been advertised to the local BGP speaker by its neighbors;
  293.    the Loc-RIB contains the routes that have been selected by the local
  294.    BGP speaker's Decision Process; and the Adj-RIBs-Out organize the
  295.    routes for advertisement to specific neighbor BGP speakers by means
  296.    of the local speaker's UPDATE messages.
  297.  
  298.    Although the conceptual model distinguishes between Adj-RIBs-In,
  299.    Loc-RIB, and Adj-RIBs-Out, this neither implies nor requires that an
  300.    implementation must maintain three separate copies of the routing
  301.    information. The choice of implementation (for example, 3 copies of
  302.    the information vs 1 copy with pointers) is not constrained by the
  303.    protocol.
  304.  
  305. 4.  Message Formats
  306.  
  307.    This section describes message formats used by BGP.
  308.  
  309.    Messages are sent over a reliable transport protocol connection.  A
  310.    message is processed only after it is entirely received.  The maximum
  311.    message size is 4096 octets.  All implementations are required to
  312.    support this maximum message size.  The smallest message that may be
  313.    sent consists of a BGP header without a data portion, or 19 octets.
  314.  
  315.  
  316. 4.1 Message Header Format
  317.  
  318.  
  319.    Each message has a fixed-size header.  There may or may not be a data
  320.    portion following the header, depending on the message type.  The
  321.    layout of these fields is shown below:
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331. Expiration Date October 1993                                    [Page 6]
  332.  
  333. INTERNET DRAFT                                                April 1993
  334.  
  335.  
  336.        0                   1                   2                   3
  337.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  338.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  339.       |                                                               |
  340.       +                                                               +
  341.       |                                                               |
  342.       +                                                               +
  343.       |                           Marker                              |
  344.       +                                                               +
  345.       |                                                               |
  346.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  347.       |          Length               |      Type     |
  348.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  349.  
  350.  
  351.       Marker:
  352.  
  353.          This 16-octet field contains a value that the receiver of the
  354.          message can predict.  If the Type of the message is OPEN, or if
  355.          the Authentication Code used in the OPEN message of the
  356.          connection is zero, then the Marker must be all ones.
  357.          Otherwise, the value of the marker can be predicted by some a
  358.          computation specified as part of the authentication mechanism
  359.          used.  The Marker can be used to detect loss of synchronization
  360.          between a pair of BGP peers, and to authenticate incoming BGP
  361.          messages.
  362.  
  363.  
  364.       Length:
  365.  
  366.          This 2-octet unsigned integer indicates the total length of the
  367.          message, including the header, in octets.  Thus, e.g., it
  368.          allows one to locate in the transport-level stream the (Marker
  369.          field of the) next message.  The value of the Length field must
  370.          always be at least 19 and no greater than 4096, and may be
  371.          further constrained, depending on the message type.  No
  372.          "padding" of extra data after the message is allowed, so the
  373.          Length field must have the smallest value required given the
  374.          rest of the message.
  375.  
  376.       Type:
  377.  
  378.          This 1-octet unsigned integer indicates the type code of the
  379.          message.  The following type codes are defined:
  380.  
  381.                                     1 - OPEN
  382.                                     2 - UPDATE
  383.                                     3 - NOTIFICATION
  384.  
  385.  
  386.  
  387. Expiration Date October 1993                                    [Page 7]
  388.  
  389. INTERNET DRAFT                                                April 1993
  390.  
  391.  
  392.                                     4 - KEEPALIVE
  393.  
  394.  
  395. 4.2 OPEN Message Format
  396.  
  397.  
  398.    After a transport protocol connection is established, the first
  399.    message sent by each side is an OPEN message.  If the OPEN message is
  400.    acceptable, a KEEPALIVE message confirming the OPEN is sent back.
  401.    Once the OPEN is confirmed, UPDATE, KEEPALIVE, and NOTIFICATION
  402.    messages may be exchanged.
  403.  
  404.    In addition to the fixed-size BGP header, the OPEN message contains
  405.    the following fields:
  406.  
  407.  
  408.  
  409.  
  410.         0                   1                   2                   3
  411.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  412.        +-+-+-+-+-+-+-+-+
  413.        |    Version    |
  414.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  415.        |     My Autonomous System      |
  416.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  417.        |           Hold Time           |
  418.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  419.        |                         BGP Identifier                        |
  420.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  421.        |  Auth. Code   |
  422.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  423.        |                                                               |
  424.        |                       Authentication Data                     |
  425.        |                                                               |
  426.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  427.  
  428.  
  429.  
  430.       Version:
  431.  
  432.          This 1-octet unsigned integer indicates the protocol version
  433.          number of the message.  The current BGP version number is 4.
  434.  
  435.       My Autonomous System:
  436.  
  437.          This 2-octet unsigned integer indicates the Autonomous System
  438.          number of the sender.
  439.  
  440.  
  441.  
  442.  
  443. Expiration Date October 1993                                    [Page 8]
  444.  
  445. INTERNET DRAFT                                                April 1993
  446.  
  447.  
  448.       Hold Time:
  449.  
  450.          This 2-octet unsigned integer indicates the maximum number of
  451.          seconds that may elapse between the receipt of successive
  452.          KEEPALIVE and/or UPDATE and/or NOTIFICATION messages by the sender,
  453.          before the sender will declare the receiver as down.
  454.  
  455.  
  456.       BGP Identifier:
  457.          This 4-octet unsigned integer indicates the BGP Identifier of
  458.          the sender. A given BGP speaker sets the value of its BGP
  459.          Identifier to an IP address assigned to that BGP speaker.
  460.          The value of the BGP Identifier is determined on startup
  461.          and is the same for every local interface and every BGP peer.
  462.  
  463.       Authentication Code:
  464.  
  465.          This 1-octet unsigned integer indicates the authentication
  466.          mechanism being used.  Whenever an authentication mechanism is
  467.          specified for use within BGP, three things must be included in the
  468.          specification:
  469.          - the value of the Authentication Code which indicates use of
  470.          the mechanism,
  471.          - the form and meaning of the Authentication Data, and
  472.          - the algorithm for computing values of Marker fields.
  473.          Only one authentication mechanism is specified as part of this
  474.          memo:
  475.          - its Authentication Code is zero,
  476.          - its Authentication Data must be empty (of zero length), and
  477.          - the Marker fields of all messages must be all ones.
  478.          The semantics of non-zero Authentication Codes lies outside the
  479.          scope of this memo.
  480.  
  481.          Note that a separate authentication mechanism may be used in
  482.          establishing the transport level connection.
  483.  
  484.       Authentication Data:
  485.  
  486.          The form and meaning of this field is a variable-length field
  487.          depend on the Authentication Code.  If the value of Authentication
  488.          Code field is zero, the Authentication Data field must have zero
  489.          length.  The semantics of the non-zero length Authentication Data
  490.          field is outside the scope of this memo.
  491.  
  492.          Note that the length of the Authentication Data field can be
  493.          determined from the message Length field by the formula:
  494.  
  495.             Message Length = 29 + Authentication Data Length
  496.  
  497.  
  498.  
  499. Expiration Date October 1993                                    [Page 9]
  500.  
  501. INTERNET DRAFT                                                April 1993
  502.  
  503.  
  504.          The minimum length of the OPEN message is 29 octets (including
  505.          message header).
  506.  
  507.  
  508. 4.3 UPDATE Message Format
  509.  
  510.  
  511.    UPDATE messages are used to transfer routing information between BGP
  512.    peers.  The information in the UPDATE packet can be used to construct
  513.    a graph describing the relationships of the various Autonomous
  514.    Systems.  By applying rules to be discussed, routing information
  515.    loops and some other anomalies may be detected and removed from
  516.    inter-AS routing.
  517.  
  518.    An UPDATE message is used to advertise a single feasible route to a
  519.    neighboring BGP speaker, or to withdraw multiple unfeasible routes
  520.    from service (see 3.1). An UPDATE message may simultaneously advertise
  521.    a feasible route and withdraw multiple unfeasible routes from service.
  522.    The UPDATE message always includes the fixed-size BGP header,
  523.    and can optionally include the other fields as shown below:
  524.  
  525.  
  526.       +-----------------------------------------------------+
  527.       |   Unfeasible Routes Length (2 octets)               |
  528.       +-----------------------------------------------------+
  529.       |  Withdrawn Routes (variable)                        |
  530.       +-----------------------------------------------------+
  531.       |   Total Path Attribute Length (2 octets)            |
  532.       +-----------------------------------------------------+
  533.       |    Path Attributes (variable)                       |
  534.       +-----------------------------------------------------+
  535.       |   Network Layer Reachability Information (variable) |
  536.       +-----------------------------------------------------+
  537.  
  538.  
  539.  
  540.       Unfeasible Routes Length:
  541.  
  542.          This 2-octets unsigned integer indicates the total length of
  543.          the Withdrawn Routes field in octets.  Its value must allow the
  544.          length of the Network Layer Reachability Information field to
  545.          be determined as specified below.
  546.  
  547.          A value of 0 indicates that no routes are being withdrawn from
  548.          service, and that the WITHDRAWN ROUTES field is not present in
  549.          this UPDATE message.
  550.  
  551.       Withdrawn Routes:
  552.  
  553.  
  554.  
  555. Expiration Date October 1993                                   [Page 10]
  556.  
  557. INTERNET DRAFT                                                April 1993
  558.  
  559.  
  560.          This is a variable length field that contains a list of IP
  561.          address prefixes for the routes that are being withdrawn from
  562.          service.  Each IP address prefix is encoded as a 2-tuple of the
  563.          form <length, prefix>, whose fields are described below:
  564.  
  565.                   +---------------------------+
  566.                   |   Length (1 octet)        |
  567.                   +---------------------------+
  568.                   |   Prefix (variable)       |
  569.                   +---------------------------+
  570.  
  571.  
  572.          The use and the meaning of these fields are as follows:
  573.  
  574.          a) Length:
  575.  
  576.             The Length field indicates the length in bits of the IP
  577.             address prefix. A length of zero indicates a prefix that
  578.             matches all IP addresses (with prefix, itself, of zero
  579.             octets).
  580.  
  581.          b) Prefix:
  582.  
  583.             The Prefix field contains IP address prefixes followed by
  584.             enough trailing bits to make the end of the field fall on an
  585.             octet boundary. Note that the value of trailing bits is
  586.             irrelevant.
  587.  
  588.       Total Path Attribute Length:
  589.  
  590.          This 2-octet unsigned integer indicates the total length of the
  591.          Path Attributes field in octets.  Its value must allow the
  592.          length of the Network Layer Reachability field to be determined
  593.          as specified below.
  594.  
  595.          A value of 0 indicates that no Network Layer Reachability
  596.          Information field is present in this UPDATE message.
  597.  
  598.       Path Attributes:
  599.  
  600.          A variable length sequence of path attributes is present in
  601.          every UPDATE.  Each path attribute is a triple <attribute type,
  602.          attribute length, attribute value> of variable length.
  603.  
  604.          Attribute Type is a two-octet field that consists of the
  605.          Attribute Flags octet followed by the Attribute Type Code
  606.          octet.
  607.  
  608.  
  609.  
  610.  
  611. Expiration Date October 1993                                   [Page 11]
  612.  
  613. INTERNET DRAFT                                                April 1993
  614.  
  615.  
  616.                 0                   1
  617.                 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
  618.                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  619.                |  Attr. Flags  |Attr. Type Code|
  620.                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  621.  
  622.  
  623.          The high-order bit (bit 0) of the Attribute Flags octet is the
  624.          Optional bit.  It defines whether the attribute is optional (if
  625.          set to 1) or well-known (if set to 0).
  626.  
  627.          The second high-order bit (bit 1) of the Attribute Flags octet
  628.          is the Transitive bit.  It defines whether an optional
  629.          attribute is transitive (if set to 1) or non-transitive (if set
  630.          to 0).  For well-known attributes, the Transitive bit must be
  631.          set to 1.  (See Section 5 for a discussion of transitive
  632.          attributes.)
  633.  
  634.          The third high-order bit (bit 2) of the Attribute Flags octet
  635.          is the Partial bit.  It defines whether the information
  636.          contained in the optional transitive attribute is partial (if
  637.          set to 1) or complete (if set to 0).  For well-known attributes
  638.          and for optional non-transitive attributes the Partial bit must
  639.          be set to 0.
  640.  
  641.          The fourth high-order bit (bit 3) of the Attribute Flags octet
  642.          is the Extended Length bit.  It defines whether the Attribute
  643.          Length is one octet (if set to 0) or two octets (if set to 1).
  644.          Extended Length may be used only if the length of the attribute
  645.          value is greater than 255 octets.
  646.  
  647.          The lower-order four bits of the Attribute Flags octet are .
  648.          unused. They must be zero (and must be ignored when received).
  649.  
  650.          The Attribute Type Code octet contains the Attribute Type Code.
  651.          Currently defined Attribute Type Codes are discussed in Section
  652.          5.
  653.  
  654.          If the Extended Length bit of the Attribute Flags octet is set
  655.          to 0, the third octet of the Path Attribute contains the length
  656.          of the attribute data in octets.
  657.  
  658.          If the Extended Length bit of the Attribute Flags octet is set
  659.          to 1, then the third and the fourth octets of the path
  660.          attribute contain the length of the attribute data in octets.
  661.  
  662.          The remaining octets of the Path Attribute represent the
  663.          attribute value and are interpreted according to the Attribute
  664.  
  665.  
  666.  
  667. Expiration Date October 1993                                   [Page 12]
  668.  
  669. INTERNET DRAFT                                                April 1993
  670.  
  671.  
  672.          Flags and the Attribute Type Code. The supported attribute
  673.          values and their uses are the following:
  674.  
  675.          a)   ORIGIN (Type Code 1):
  676.  
  677.             ORIGIN is a well-known mandatory attribute that defines the
  678.             origin of the path information.   The data octet can assume
  679.             the following values:
  680.  
  681.                   Value      Meaning
  682.  
  683.                   0         IGP - Network Layer Reachability Information
  684.                                is interior to the originating AS
  685.  
  686.                   1         EGP - Network Layer Reachability Information
  687.                                learned via EGP
  688.  
  689.                   2         INCOMPLETE - Network Layer Reachability
  690.                                Information learned by some other means
  691.  
  692.             Its usage is defined in 5.1.1
  693.  
  694.          b) AS_PATH (Type Code 2):
  695.  
  696.             AS_PATH is a well-known mandatory attribute that is composed
  697.             of a sequence of AS path segments. Each AS path segment is
  698.             represented by a triple <path segment type, path segment
  699.             length, path segment value>.
  700.  
  701.             The path segment type is a 1-octet long field with the
  702.             following values defined:
  703.  
  704.                   Value      Segment Type
  705.  
  706.                   1         AS_SET: unordered set of ASs a route in the
  707.                                UPDATE message has traversed
  708.  
  709.                   2         AS_SEQUENCE: ordered set of ASs a route in
  710.                                the UPDATE message has traversed
  711.  
  712.             The path segment length is a 1-octet long field containing
  713.             the number of ASs in the path segment value field.
  714.  
  715.             The path segment value field contains one or more AS
  716.             numbers, each encoded as a 2-octets long field.
  717.  
  718.             Usage of this attribute is defined in 5.1.2.
  719.  
  720.  
  721.  
  722.  
  723. Expiration Date October 1993                                   [Page 13]
  724.  
  725. INTERNET DRAFT                                                April 1993
  726.  
  727.  
  728.          c)   NEXT_HOP (Type Code 3):
  729.  
  730.             This is a well-known mandatory attribute that defines the IP
  731.             address of the border router that should be used as the next
  732.             hop to the destinations listed in the Network Layer
  733.             Reachability field of the UPDATE message.
  734.  
  735.             Usage of this attribute is defined in 5.1.3.
  736.  
  737.  
  738.          d) MULTI_EXIT_DISC (Type Code 4):
  739.  
  740.             This is an optional non-transitive attribute that is a four
  741.             octet non-negative integer. The value of this attribute may
  742.             be used by a BGP speaker's decision process to discriminate
  743.             between multiple exit points to an adjacent autonomous
  744.             system.
  745.  
  746.             Its usage is defined in 5.1.4.
  747.  
  748.          e) LOCAL_PREF (Type Code 5):
  749.  
  750.             LOCAL_PREF is a well-known discretionary attribute that is a
  751.             four octet non-negative integer. It is used by a BGP speaker
  752.             to inform other BGP speakers in its own autonomous system of
  753.             the originating speaker's degree of preference for an
  754.             advertised route. Usage of this attribute is described in
  755.             5.1.5.
  756.  
  757.          f) ATOMIC_AGGREGATE (Type Code 6)
  758.  
  759.             ATOMIC_AGGREGATE is a well-known discretionary attribute of
  760.             length 0. It is used by a BGP speaker to inform other BGP
  761.             speakers that the local system selected a less specific
  762.             route without selecting a more specific route which is
  763.             included in it. Usage of this attribute is described in
  764.             5.1.6.
  765.  
  766.          g) AGGREGATOR (Type Code 7)
  767.  
  768.             AGGREGATOR is an optional transitive attribute of length 2.
  769.             It is used by a BGP speaker to to indicate the AS number of
  770.             the last AS that formed the aggregate route.  Usage of this
  771.             attribute is described in 5.1.7
  772.  
  773.       Network Layer Reachability Information:
  774.  
  775.          This variable length field contains a list of IP address
  776.  
  777.  
  778.  
  779. Expiration Date October 1993                                   [Page 14]
  780.  
  781. INTERNET DRAFT                                                April 1993
  782.  
  783.  
  784.          prefixes.  The length in octets of the Network Layer
  785.          Reachability Information is not encoded explicitly, but can be
  786.          calculated as:
  787.  
  788.             UPDATE message Length - 23 - Total Path Attributes Length -
  789.             Unfeasible Routes Length
  790.  
  791.          where UPDATE message Length is the value encoded in the fixed-
  792.          size BGP header, Total Path Attribute Length and Unfeasible
  793.          Routes Length  are the values encoded in the variable part of
  794.          the UPDATE message, and 23 is a combined length of the fixed-
  795.          size BGP header, the Total Path Attribute Length field and the
  796.          Unfeasible Routes Length field.
  797.  
  798.          Reachability information is encoded as one or more 2-tuples of
  799.          the form <length, prefix>, whose fields are described below:
  800.  
  801.  
  802.                   +---------------------------+
  803.                   |   Length (1 octet)        |
  804.                   +---------------------------+
  805.                   |   Prefix (variable)       |
  806.                   +---------------------------+
  807.  
  808.  
  809.          The use and the meaning of these fields are as follows:
  810.  
  811.          a) Length:
  812.  
  813.             The Length field indicates the length in bits of the IP
  814.             address prefix. A length of zero indicates a prefix that
  815.             matches all IP addresses (with prefix, itself, of zero
  816.             octets).
  817.  
  818.          b) Prefix:
  819.  
  820.             The Prefix field contains IP address prefixes followed by
  821.             enough trailing bits to make the end of the field fall on an
  822.             octet boundary. Note that the value of the trailing bits is
  823.             irrelevant.
  824.  
  825.    The minimum length of the UPDATE message is 33 octets (including
  826.    message header).
  827.  
  828.  
  829.    An UPDATE message can advertise at most one route, which may be
  830.    described by several path attributes. All path attributes contained
  831.    in a given UPDATE messages apply to the destinations carried in the
  832.  
  833.  
  834.  
  835. Expiration Date October 1993                                   [Page 15]
  836.  
  837. INTERNET DRAFT                                                April 1993
  838.  
  839.  
  840.    Network Layer Reachability Information field of the UPDATE message.
  841.  
  842.    An UPDATE message can list multiple routes to be withdrawn from
  843.    service.  Each such route is identified by its destination (expressed
  844.    as an IP prefix), which unambiguously identifies the route in the
  845.    context of the BGP speaker - BGP speaker connection to which it has
  846.    been previously been advertised.
  847.  
  848.    An UPDATE message may advertise only routes to be withdrawn from
  849.    service, in which case it will not include path attributes or Network
  850.    Layer Reachability Information. Conversely, it may advertise only a
  851.    feasible route, in which case the WITHDRAWN ROUTES field need not be
  852.    present.
  853.  
  854.  
  855. 4.4 KEEPALIVE Message Format
  856.  
  857.  
  858.    BGP does not use any transport protocol-based keep-alive mechanism to
  859.    determine if peers are reachable.  Instead, KEEPALIVE messages are
  860.    exchanged between peers often enough as not to cause the hold time
  861.    (as advertised in the OPEN message) to expire.  A reasonable maximum
  862.    time between KEEPALIVE messages would be one third of the Hold Time
  863.    interval.
  864.  
  865.    KEEPALIVE message consists of only message header and has a length of
  866.    19 octets.
  867.  
  868.  
  869. 4.5 NOTIFICATION Message Format
  870.  
  871.  
  872.    A NOTIFICATION message is sent when an error condition is detected.
  873.    The BGP connection is closed immediately after sending it.
  874.  
  875.    In addition to the fixed-size BGP header, the NOTIFICATION message
  876.    contains the following fields:
  877.  
  878.  
  879.         0                   1                   2                   3
  880.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  881.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  882.        | Error code    | Error subcode |           Data                |
  883.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
  884.        |                                                               |
  885.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  886.  
  887.  
  888.  
  889.  
  890.  
  891. Expiration Date October 1993                                   [Page 16]
  892.  
  893. INTERNET DRAFT                                                April 1993
  894.  
  895.  
  896.       Error Code:
  897.  
  898.          This 1-octet unsigned integer indicates the type of
  899.          NOTIFICATION.  The following Error Codes have been defined:
  900.  
  901.             Error Code       Symbolic Name               Reference
  902.  
  903.               1         Message Header Error             Section 6.1
  904.  
  905.               2         OPEN Message Error               Section 6.2
  906.  
  907.               3         UPDATE Message Error             Section 6.3
  908.  
  909.               4         Hold Timer Expired               Section 6.5
  910.  
  911.               5         Finite State Machine Error       Section 6.6
  912.  
  913.               6         Cease                            Section 6.7
  914.  
  915.  
  916.       Error subcode:
  917.  
  918.          This 1-octet unsigned integer provides more specific
  919.          information about the nature of the reported error.  Each Error
  920.          Code may have one or more Error Subcodes associated with it.
  921.          If no appropriate Error Subcode is defined, then a zero
  922.          (Unspecific) value is used for the Error Subcode field.
  923.  
  924.          Message Header Error subcodes:
  925.  
  926.                                1  - Connection Not Synchronized.
  927.                                2  - Bad Message Length.
  928.                                3  - Bad Message Type.
  929.  
  930.          OPEN Message Error subcodes:
  931.  
  932.                                1  - Unsupported Version Number.
  933.                                2  - Bad Peer AS.
  934.                                3  - Bad BGP Identifier.
  935.                                4  - Unsupported Authentication Code.
  936.                                5  - Authentication Failure.
  937.  
  938.          UPDATE Message Error subcodes:
  939.  
  940.                                1 - Malformed Attribute List.
  941.                                2 - Unrecognized Well-known Attribute.
  942.                                3 - Missing Well-known Attribute.
  943.                                4 - Attribute Flags Error.
  944.  
  945.  
  946.  
  947. Expiration Date October 1993                                   [Page 17]
  948.  
  949. INTERNET DRAFT                                                April 1993
  950.  
  951.  
  952.                                5 - Attribute Length Error.
  953.                                6 - Invalid ORIGIN Attribute
  954.                                7 - AS Routing Loop.
  955.                                8 - Invalid NEXT_HOP Attribute.
  956.                                9 - Optional Attribute Error.
  957.                               10 - Invalid Network Field.
  958.                               11 - Malformed AS_PATH.
  959.  
  960.       Data:
  961.  
  962.          This variable-length field is used to diagnose the reason for
  963.          the NOTIFICATION.  The contents of the Data field depend upon
  964.          the Error Code and Error Subcode.  See Section 6 below for more
  965.          details.
  966.  
  967.          Note that the length of the Data field can be determined from
  968.          the message Length field by the formula:
  969.  
  970.                   Message Length = 21 + Data Length
  971.  
  972.  
  973.    The minimum length of the NOTIFICATION message is 21 octets
  974.    (including message header).
  975.  
  976.  
  977. 5.  Path Attributes
  978.  
  979.  
  980.    This section discusses the path attributes of the UPDATE message.
  981.  
  982.    Path attributes fall into four separate categories:
  983.  
  984.                1. Well-known mandatory.
  985.                2. Well-known discretionary.
  986.                3. Optional transitive.
  987.                4. Optional non-transitive.
  988.  
  989.    Well-known attributes must be recognized by all BGP implementations.
  990.    Some of these attributes are mandatory and must be included in every
  991.    UPDATE message.  Others are discretionary and may or may not be sent
  992.    in a particular UPDATE message.
  993.  
  994.    All well-known attributes must be passed along (after proper
  995.    updating, if necessary) to other BGP peers.
  996.  
  997.    In addition to well-known attributes, each path may contain one or
  998.    more optional attributes.  It is not required or expected that all
  999.    BGP implementations support all optional attributes.  The handling of
  1000.  
  1001.  
  1002.  
  1003. Expiration Date October 1993                                   [Page 18]
  1004.  
  1005. INTERNET DRAFT                                                April 1993
  1006.  
  1007.  
  1008.    an unrecognized optional attribute is determined by the setting of
  1009.    the Transitive bit in the attribute flags octet.  Paths with
  1010.    unrecognized transitive optional attributes should be accepted. If a
  1011.    path with unrecognized transitive optional attribute is accepted and
  1012.    passed along to other BGP peers, then the unrecognized transitive
  1013.    optional attribute of that path must be passed along with the path to
  1014.    other BGP peers with the Partial bit in the Attribute Flags octet set
  1015.    to 1. If a path with recognized transitive optional attribute is
  1016.    accepted and passed along to other BGP peers and the Partial bit in
  1017.    the Attribute Flags octet is set to 1 by some previous AS, it is not
  1018.    set back to 0 by the current AS. Unrecognized non-transitive optional
  1019.    attributes must be quietly ignored and not passed along to other BGP
  1020.    peers.
  1021.  
  1022.    New transitive optional attributes may be attached to the path by the
  1023.    originator or by any other AS in the path.  If they are not attached
  1024.    by the originator, the Partial bit in the Attribute Flags octet is
  1025.    set to 1.  The rules for attaching new non-transitive optional
  1026.    attributes will depend on the nature of the specific attribute.  The
  1027.    documentation of each new non-transitive optional attribute will be
  1028.    expected to include such rules.  (The description of the
  1029.    MULTI_EXIT_DISC attribute gives an example.)  All optional attributes
  1030.    (both transitive and non-transitive) may be updated (if appropriate)
  1031.    by ASs in the path.
  1032.  
  1033.    The sender of an UPDATE message should order path attributes within
  1034.    the UPDATE message in ascending order of attribute type.  The
  1035.    receiver of an UPDATE message must be prepared to handle path
  1036.    attributes within the UPDATE message that are out of order.
  1037.  
  1038.    The same attribute cannot appear more than once within the Path
  1039.    Attributes field of a particular UPDATE message.
  1040.  
  1041.  
  1042.  
  1043. 5.1 Path Attribute Usage
  1044.  
  1045.  
  1046.    The usage of each BGP path attributes is described in the following
  1047.    clauses.
  1048.  
  1049.  
  1050.  
  1051. 5.1.1 ORIGIN
  1052.  
  1053.  
  1054.    ORIGIN is a well-known mandatory attribute. The ORIGIN attribute
  1055.    shall be generated by the autonomous system that originates the
  1056.  
  1057.  
  1058.  
  1059. Expiration Date October 1993                                   [Page 19]
  1060.  
  1061. INTERNET DRAFT                                                April 1993
  1062.  
  1063.  
  1064.    associated routing information. It shall be included in the UPDATE
  1065.    messages of all BGP speakers that choose to propagate this
  1066.    information to other BGP speakers.
  1067.  
  1068.  
  1069. 5.1.2   AS_PATH
  1070.  
  1071.  
  1072.    AS_PATH is a well-known mandatory attribute. This attribute
  1073.    identifies the autonomous systems through which routing information
  1074.    carried in this UPDATE message has passed. The components of this
  1075.    list can be AS_SETs or AS_SEQUENCEs.
  1076.  
  1077.    When a BGP speaker propagates a route which it has learned from
  1078.    another BGP speaker's UPDATE message, it shall modify the route's
  1079.    AS_PATH attribute based on the location of the BGP speaker to which
  1080.    the route will be sent:
  1081.  
  1082.       a) When a given BGP speaker advertises the route to another BGP
  1083.       speaker located in its own autonomous system, the advertising
  1084.       speaker shall not modify the AS_PATH attribute associated with the
  1085.       route.
  1086.  
  1087.       b) When a given BGP speaker advertises the route to a BGP speaker
  1088.       located in an adjacent autonomous system, then the advertising
  1089.       speaker shall update the AS_PATH attribute as follows:
  1090.  
  1091.          1) if the first path segment of the AS_PATH is of type
  1092.          AS_SEQUENCE, the local system shall prepend its own AS number
  1093.          as the last element of the sequence  (put it in the leftmost
  1094.          position)
  1095.  
  1096.          2) if the first path segment of the AS_PATH is of type AS_SET,
  1097.          the local system shall prepend a new path segment of type
  1098.          AS_SEQUENCE to the AS_PATH, including its own AS number in that
  1099.          segment.
  1100.  
  1101.       When a BGP speaker originates a route then:
  1102.  
  1103.  
  1104.          a) the originating speaker shall include its own AS number in
  1105.          the AS_PATH attribute of all UPDATE messages sent to BGP
  1106.          speakers located in adjacent autonomous systems. (In this case,
  1107.          the AS number of the originating speaker's autonomous system
  1108.          will be the only entry in the AS_PATH attribute).
  1109.  
  1110.          b) the originating speaker shall include an empty AS_PATH
  1111.          attribute in all UPDATE messages sent to BGP speakers located
  1112.  
  1113.  
  1114.  
  1115. Expiration Date October 1993                                   [Page 20]
  1116.  
  1117. INTERNET DRAFT                                                April 1993
  1118.  
  1119.  
  1120.          in its own autonomous system. (An empty AS_PATH attribute is
  1121.          one whose length field contains the value zero).
  1122.  
  1123.  
  1124. 5.1.3 NEXT_HOP
  1125.  
  1126.  
  1127.    The NEXT_HOP path attribute defines the IP address of the border
  1128.    router that should be used as the next hop to the networks listed in
  1129.    the UPDATE message.  If a border router belongs to the same AS as its
  1130.    peer, then the peer is an internal border router. Otherwise, it is an
  1131.    external border router.  A BGP speaker can advertise any internal
  1132.    border router as the next hop provided that the interface associated
  1133.    with the IP address of this border router (as specified in the
  1134.    NEXT_HOP path attribute) shares a common subnet with both the local
  1135.    and remote BGP speakers. A BGP speaker can advertise any external
  1136.    border router as the next hop, provided that the IP address of this
  1137.    border router was learned from one of the BGP speaker's peers, and
  1138.    the interface associated with the IP address of this border router
  1139.    (as specified in the NEXT_HOP path attribute) shares a common subnet
  1140.    with the local and remote BGP speakers.  A BGP speaker needs to be
  1141.    able to support disabling advertisement of external border routers.
  1142.  
  1143.    A BGP speaker must never advertise an address of a neighbor to that
  1144.    neighbor as a NEXT_HOP, for a route that the speaker is originating.
  1145.    A BGP speaker must never install a route with itself as the next hop.
  1146.  
  1147.    When a BGP speaker advertises the route to a BGP speaker located in
  1148.    its own autonomous system, the advertising speaker shall not modify
  1149.    the NEXT_HOP attribute associated with the route.  When a BGP speaker
  1150.    receives the route via an internal link, it may use that NEXT_HOP if
  1151.    the address contained in the attribute is on a common subnet with the
  1152.    local and remote BGP speakers.  The BGP speaker may also use the
  1153.    NEXT_HOP address if the IGP does not contain a route for the
  1154.    destination.
  1155.  
  1156.  
  1157. 5.1.4   MULTI_EXIT_DISC
  1158.  
  1159.  
  1160.    The MULTI_EXIT_DISC attribute may be used on external (inter-AS)
  1161.    links to discriminate between multiple exit or entry points to the
  1162.    same neighboring AS.  The value of the MULTI_EXIT_DISC attribute is a
  1163.    four octet unsigned number which is called a metric.  All other
  1164.    factors being equal, the exit or entry point with lower metric should
  1165.    be preferred.  If received over external links, the MULTI_EXIT_DISC
  1166.    attribute may be propagated over internal links to other BGP speakers
  1167.    within the same AS.  The MULTI_EXIT_DISC attribute is never
  1168.  
  1169.  
  1170.  
  1171. Expiration Date October 1993                                   [Page 21]
  1172.  
  1173. INTERNET DRAFT                                                April 1993
  1174.  
  1175.  
  1176.    propagated to other BGP speakers in neighboring AS's.
  1177.  
  1178.  
  1179. 5.1.5   LOCAL_PREF
  1180.  
  1181.  
  1182.    LOCAL_PREF is a well-known discretionary attribute that shall be
  1183.    included in all UPDATE messages that a given BGP speaker sends to the
  1184.    other BGP speakers located in its own autonomous system. A BGP
  1185.    speaker shall calculate the degree of preference for each external
  1186.    route and include the degree of preference when advertising a route
  1187.    to its internal neighbors. The higher degree of preference should be
  1188.    preferred. A BGP speaker shall use the degree of preference learned
  1189.    via LOCAL_PREF in its decision process (see section 9.1.1).
  1190.  
  1191.    A BGP speaker shall not include this attribute in UPDATE messages
  1192.    that it sends to BGP speakers located in an adjacent autonomous
  1193.    system. It is contained in an UPDATE message that is received from a
  1194.    BGP speaker which is not located in the same autonomous system as the
  1195.    receiving speaker, then this attribute shall be ignored by the
  1196.    receiving speaker.
  1197.  
  1198.  
  1199. 5.1.6   ATOMIC_AGGREGATE
  1200.  
  1201.  
  1202.    ATOMIC_AGGREGATE is a well-known discretionary attribute.  If a BGP
  1203.    speaker, when presented with a set of overlapping routes from one of
  1204.    its peers (see 9.1.4), selects the less specific route without
  1205.    selecting the more specific one, then the local system shall attach
  1206.    the ATOMIC_AGGREGATE attribute to the route when propagating it to
  1207.    other BGP speakers (if that attribute is not already present in the
  1208.    received less specific route). A BGP speaker that receives a route
  1209.    with the ATOMIC_AGGREGATE attribute shall not remove the attribute
  1210.    from the route when propagating it to other speakers. A BGP speaker
  1211.    that receives a route with the ATOMIC_AGGREGATE attribute shall not
  1212.    make any NLRI of that route more specific (as defined in 9.1.4) when
  1213.    advertising this route to other BGP speakers.  A BGP speaker that
  1214.    receives a route with the ATOMIC_AGGREGATE attribute needs to be
  1215.    cognizant of the fact that the actual path to destinations, as
  1216.    specified in the NLRI of the route, while having the loop-free
  1217.    property, may traverse ASs that are not listed in the AS_PATH
  1218.    attribute.
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227. Expiration Date October 1993                                   [Page 22]
  1228.  
  1229. INTERNET DRAFT                                                April 1993
  1230.  
  1231.  
  1232. 5.1.7   AGGREGATOR
  1233.  
  1234.  
  1235.    AGGREGATOR is an optional transitive attribute which may be included
  1236.    in updates which are formed by aggregation (see Section 9.2.4.2).  A
  1237.    BGP speaker which performs route aggregation may add the AGGREGATOR
  1238.    attribute which shall contain its own AS number.
  1239.  
  1240.  
  1241. 6.  BGP Error Handling.
  1242.  
  1243.  
  1244.    This section describes actions to be taken when errors are detected
  1245.    while processing BGP messages.
  1246.  
  1247.    When any of the conditions described here are detected, a
  1248.    NOTIFICATION message with the indicated Error Code, Error Subcode,
  1249.    and Data fields is sent, and the BGP connection is closed.  If no
  1250.    Error Subcode is specified, then a zero must be used.
  1251.  
  1252.    The phrase "the BGP connection is closed" means that the transport
  1253.    protocol connection has been closed and that all resources for that
  1254.    BGP connection have been deallocated.  Routing table entries
  1255.    associated with the remote peer are marked as invalid.  The fact that
  1256.    the routes have become invalid is passed to other BGP peers before
  1257.    the routes are deleted from the system.
  1258.  
  1259.    Unless specified explicitly, the Data field of the NOTIFICATION
  1260.    message that is sent to indicate an error is empty.
  1261.  
  1262.  
  1263. 6.1 Message Header error handling.
  1264.  
  1265.  
  1266.    All errors detected while processing the Message Header are indicated
  1267.    by sending the NOTIFICATION message with Error Code Message Header
  1268.    Error.  The Error Subcode elaborates on the specific nature of the
  1269.    error.
  1270.  
  1271.    The expected value of the Marker field of the message header is all
  1272.    ones if the message type is OPEN.  The expected value of the Marker
  1273.    field for all other types of BGP messages determined based on the
  1274.    Authentication Code in the BGP OPEN message and the actual
  1275.    authentication mechanism (if the Authentication Code in the BGP OPEN
  1276.    message is non-zero). If the Marker field of the message header is
  1277.    not the expected one, then a synchronization error has occurred and
  1278.    the Error Subcode is set to Connection Not Synchronized.
  1279.  
  1280.  
  1281.  
  1282.  
  1283. Expiration Date October 1993                                   [Page 23]
  1284.  
  1285. INTERNET DRAFT                                                April 1993
  1286.  
  1287.  
  1288.    If the Length field of the message header is less than 19 or greater
  1289.    than 4096, or if the Length field of an OPEN message is less  than
  1290.    the minimum length of the OPEN message, or if the Length field of an
  1291.    UPDATE message is less than the minimum length of the UPDATE message,
  1292.    or if the Length field of a KEEPALIVE message is not equal to 19, or
  1293.    if the Length field of a NOTIFICATION message is less than the
  1294.    minimum length of the NOTIFICATION message, then the Error Subcode is
  1295.    set to Bad Message Length.  The Data field contains the erroneous
  1296.    Length field.
  1297.  
  1298.    If the Type field of the message header is not recognized, then the
  1299.    Error Subcode is set to Bad Message Type.  The Data field contains
  1300.    the erroneous Type field.
  1301.  
  1302.  
  1303. 6.2 OPEN message error handling.
  1304.  
  1305.  
  1306.    All errors detected while processing the OPEN message are indicated
  1307.    by sending the NOTIFICATION message with Error Code OPEN Message
  1308.    Error.  The Error Subcode elaborates on the specific nature of the
  1309.    error.
  1310.  
  1311.    If the version number contained in the Version field of the received
  1312.    OPEN message is not supported, then the Error Subcode is set to
  1313.    Unsupported Version Number.  The Data field is a 2-octet unsigned
  1314.    integer, which indicates the largest locally supported version number
  1315.    less than the version the remote BGP peer bid (as indicated in the
  1316.    received OPEN message).
  1317.  
  1318.    If the Autonomous System field of the OPEN message is unacceptable,
  1319.    then the Error Subcode is set to Bad Peer AS.  The determination of
  1320.    acceptable Autonomous System numbers is outside the scope of this
  1321.    protocol.
  1322.  
  1323.    If the BGP Identifier field of the OPEN message is syntactically
  1324.    incorrect, then the Error Subcode is set to Bad BGP Identifier.
  1325.    Syntactic correctness means that the BGP Identifier field represents
  1326.    a valid IP host address.
  1327.  
  1328.    If the Authentication Code of the OPEN message is not recognized,
  1329.    then the Error Subcode is set to Unsupported Authentication Code.  If
  1330.    the Authentication Code is zero, then the Authentication Data must be
  1331.    of zero length.  Otherwise, the Error Subcode is set to
  1332.    Authentication Failure.
  1333.  
  1334.    If the Authentication Code is non-zero, then the corresponding
  1335.    authentication procedure is invoked.  If the authentication procedure
  1336.  
  1337.  
  1338.  
  1339. Expiration Date October 1993                                   [Page 24]
  1340.  
  1341. INTERNET DRAFT                                                April 1993
  1342.  
  1343.  
  1344.    (based on Authentication Code and Authentication Data) fails, then
  1345.    the Error Subcode is set to Authentication Failure.
  1346.  
  1347.  
  1348. 6.3 UPDATE message error handling.
  1349.  
  1350.  
  1351.    All errors detected while processing the UPDATE message are indicated
  1352.    by sending the NOTIFICATION message with Error Code UPDATE Message
  1353.    Error.  The error subcode elaborates on the specific nature of the
  1354.    error.
  1355.  
  1356.    Error checking of an UPDATE message begins by examining the path
  1357.    attributes.  If the Total Attribute Length is too large (i.e., if
  1358.    Total Attribute Length + 21 exceeds the message Length), or if the
  1359.    (non-negative integer) Number of Network fields cannot be computed as
  1360.    in Section 4.3, then the Error Subcode is set to Malformed Attribute
  1361.    List.
  1362.  
  1363.    If any recognized attribute has Attribute Flags that conflict with
  1364.    the Attribute Type Code, then the Error Subcode is set to Attribute
  1365.    Flags Error.  The Data field contains the erroneous attribute (type,
  1366.    length and value).
  1367.  
  1368.    If any recognized attribute has Attribute Length that conflicts with
  1369.    the expected length (based on the attribute type code), then the
  1370.    Error Subcode is set to Attribute Length Error.  The Data field
  1371.    contains the erroneous attribute (type, length and value).
  1372.  
  1373.    If any of the mandatory well-known attributes are not present, then
  1374.    the Error Subcode is set to Missing Well-known Attribute.  The Data
  1375.    field contains the Attribute Type Code of the missing well-known
  1376.    attribute.
  1377.  
  1378.    If any of the mandatory well-known attributes are not recognized,
  1379.    then the Error Subcode is set to Unrecognized Well-known Attribute.
  1380.    The Data field contains the unrecognized attribute (type, length and
  1381.    value).
  1382.  
  1383.    If the ORIGIN attribute has an undefined value, then the Error
  1384.    Subcode is set to Invalid Origin Attribute.  The Data field contains
  1385.    the unrecognized attribute (type, length and value).
  1386.  
  1387.    If the NEXT_HOP attribute field is syntactically or semantically
  1388.    incorrect, then the Error Subcode is set to Invalid NEXT_HOP
  1389.    Attribute.
  1390.  
  1391.    The Data field contains the incorrect attribute (type, length and
  1392.  
  1393.  
  1394.  
  1395. Expiration Date October 1993                                   [Page 25]
  1396.  
  1397. INTERNET DRAFT                                                April 1993
  1398.  
  1399.  
  1400.    value).  Syntactic correctness means that the NEXT_HOP attribute
  1401.    represents a valid IP host address.  Semantic correctness applies
  1402.    only to the external BGP links. It means that the interface
  1403.    associated with the IP address, as specified in the NEXT_HOP
  1404.    attribute, shares a common subnet with the receiving BGP speaker and
  1405.    is not the IP address of the receiving BGP speaker.
  1406.  
  1407.    The AS_PATH attribute is checked for syntactic correctness.  If the
  1408.    path is syntactically incorrect, then the Error Subcode is set to
  1409.    Malformed AS_PATH.
  1410.  
  1411.    The AS route specified by the AS_PATH attribute is checked for AS
  1412.    loops.  AS loop detection is done by scanning the full AS route (as
  1413.    specified in the AS_PATH attribute) and checking that each AS occurs
  1414.    at most once.  If a loop is detected, then the Error Subcode is set
  1415.    to AS Routing Loop.  The Data field contains the incorrect attribute
  1416.    (type, length and value).
  1417.  
  1418.    If an optional attribute is recognized, then the value of this
  1419.    attribute is checked.  If an error is detected, the attribute is
  1420.    discarded, and the Error Subcode is set to Optional Attribute Error.
  1421.    The Data field contains the attribute (type, length and value).
  1422.  
  1423.    If any attribute appears more than once in the UPDATE message, then
  1424.    the Error Subcode is set to Malformed Attribute List.
  1425.  
  1426.    Each Network field in the UPDATE message is checked for syntactic
  1427.    validity.  If the Network field is syntactically incorrect, or
  1428.    contains a subnet or a host address, then the Error Subcode is set to
  1429.    Invalid Network Field.
  1430.  
  1431.  
  1432. 6.4 NOTIFICATION message error handling.
  1433.  
  1434.  
  1435.    If a peer sends a NOTIFICATION message, and there is an error in that
  1436.    message, there is unfortunately no means of reporting this error via
  1437.    a subsequent NOTIFICATION message.  Any such error, such as an
  1438.    unrecognized Error Code or Error Subcode, should be noticed, logged
  1439.    locally, and brought to the attention of the administration of the
  1440.    peer.  The means to do this, however, lies outside the scope of this
  1441.    document.
  1442.  
  1443.  
  1444. 6.5 Hold Timer Expired error handling.
  1445.  
  1446.  
  1447.    If a system does not receive successive KEEPALIVE and/or UPDATE
  1448.  
  1449.  
  1450.  
  1451. Expiration Date October 1993                                   [Page 26]
  1452.  
  1453. INTERNET DRAFT                                                April 1993
  1454.  
  1455.  
  1456.    and/or NOTIFICATION messages within the period specified in the Hold
  1457.    Time field of the OPEN message, then the NOTIFICATION message with
  1458.    Hold Timer Expired Error Code must be sent and the BGP connection
  1459.    closed.
  1460.  
  1461.  
  1462. 6.6 Finite State Machine error handling.
  1463.  
  1464.  
  1465.    Any error detected by the BGP Finite State Machine (e.g., receipt of
  1466.    an unexpected event) is indicated by sending the NOTIFICATION message
  1467.    with Error Code Finite State Machine Error.
  1468.  
  1469.  
  1470. 6.7 Cease.
  1471.  
  1472.  
  1473.    In absence of any fatal errors (that are indicated in this section),
  1474.    a BGP peer may choose at any given time to close its BGP connection
  1475.    by sending the NOTIFICATION message with Error Code Cease.  However,
  1476.    the Cease NOTIFICATION message must not be used when a fatal error
  1477.    indicated by this section does exist.
  1478.  
  1479.  
  1480. 6.8 Connection collision detection.
  1481.  
  1482.  
  1483.    If a pair of BGP speakers try simultaneously to establish a TCP
  1484.    connection to each other, then two parallel connections between this
  1485.    pair of speakers might well be formed.  We refer to this situation as
  1486.    connection collision.  Clearly, one of these connections must be
  1487.    closed.
  1488.  
  1489.    Based on the value of the BGP Identifier a convention is established
  1490.    for detecting which BGP connection is to be preserved when a
  1491.    collision does occur. The convention is to compare the BGP
  1492.    Identifiers of the peers involved in the collision and to retain only
  1493.    the connection initiated by the BGP speaker with the higher-valued
  1494.    BGP Identifier.
  1495.  
  1496.    Upon receipt of an OPEN message, the local system must examine all of
  1497.    its connections that are in the OpenConfirm state.  A BGP speaker may
  1498.    also examine connections in an OpenSent state if it knows the BGP
  1499.    Identifier of the neighbor by means outside of the protocol.  If
  1500.    among these connections there is a connection to a remote BGP speaker
  1501.    whose BGP Identifier equals the one in the OPEN message, then the
  1502.    local system performs the following collision resolution procedure:
  1503.  
  1504.  
  1505.  
  1506.  
  1507. Expiration Date October 1993                                   [Page 27]
  1508.  
  1509. INTERNET DRAFT                                                April 1993
  1510.  
  1511.  
  1512.       1. The BGP Identifier of the local system is compared to the BGP
  1513.       Identifier of the remote system (as specified in the OPEN
  1514.       message).
  1515.  
  1516.       2. If the value of the local BGP Identifier is less than the
  1517.       remote one, the local system closes BGP connection that already
  1518.       exists (the one that is already in the OpenConfirm state), and
  1519.       accepts BGP connection initiated by the remote system.
  1520.  
  1521.       3. Otherwise, the local system closes newly created BGP connection
  1522.       (the one associated with the newly received OPEN message), and
  1523.       continues to use the existing one (the one that is already in the
  1524.       OpenConfirm state).
  1525.  
  1526.       Comparing BGP Identifiers is done by treating them as (4-octet
  1527.       long) unsigned integers.
  1528.  
  1529.       A connection collision with an existing BGP connection that is in
  1530.       Established states causes unconditional closing of the newly
  1531.       created connection. Note that a connection collision cannot be
  1532.       detected with connections that are in Idle, or Connect, or Active
  1533.       states.
  1534.  
  1535.       Closing the BGP connection (that results from the collision
  1536.       resolution procedure) is accomplished by sending the NOTIFICATION
  1537.       message with the Error Code Cease.
  1538.  
  1539.  
  1540. 7.  BGP Version Negotiation.
  1541.  
  1542.  
  1543.    BGP speakers may negotiate the version of the protocol by making
  1544.    multiple attempts to open a BGP connection, starting with the highest
  1545.    version number each supports.  If an open attempt fails with an Error
  1546.    Code OPEN Message Error, and an Error Subcode Unsupported Version
  1547.    Number, then the BGP speaker has available the version number it
  1548.    tried, the version number its peer tried, the version number passed
  1549.    by its peer in the NOTIFICATION message, and the version numbers that
  1550.    it supports.  If the two peers do support one or more common
  1551.    versions, then this will allow them to rapidly determine the highest
  1552.    common version. In order to support BGP version negotiation, future
  1553.    versions of BGP must retain the format of the OPEN and NOTIFICATION
  1554.    messages.
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563. Expiration Date October 1993                                   [Page 28]
  1564.  
  1565. INTERNET DRAFT                                                April 1993
  1566.  
  1567.  
  1568. 8.  BGP Finite State machine.
  1569.  
  1570.  
  1571.    This section specifies BGP operation in terms of a Finite State
  1572.    Machine (FSM).  Following is a brief summary and overview of BGP
  1573.    operations by state as determined by this FSM.  A condensed version
  1574.    of the BGP FSM is found in Appendix 1.
  1575.  
  1576.       Initially BGP is in the Idle state.
  1577.  
  1578.       Idle state:
  1579.  
  1580.          In this state BGP refuses all incoming BGP connections.  No
  1581.          resources are allocated to the BGP neighbor.  In response to
  1582.          the Start event (initiated by either system or operator) the
  1583.          local system initializes all BGP resources, starts the
  1584.          ConnectRetry timer, initiates a transport connection to other
  1585.          BGP peer, while listening for connection that may be initiated
  1586.          by the remote BGP peer, and changes its state to Connect.  The
  1587.          exact value of the ConnectRetry timer is a local matter, but
  1588.          should be sufficiently large to allow TCP initialization.
  1589.  
  1590.          If a BGP speaker detects an error, it shuts down the connection
  1591.          and changes its state to Idle. Getting out of the Idle state
  1592.          requires generation of the Start event.  If such an event is
  1593.          generated automatically, then persistent BGP errors may result
  1594.          in persistent flapping of the speaker.  To avoid such a
  1595.          condition it is recommended that Start events should not be
  1596.          generated immediately for a peer that was previously
  1597.          transitioned to Idle due to an error. For a peer that was
  1598.          previously transitioned to Idle due to an error, the time
  1599.          between consecutive generation of Start events, if such events
  1600.          are generated automatically, shall exponentially increase. The
  1601.          value of the initial timer shall be 60 seconds. The time shall
  1602.          be doubled for each consecutive retry.
  1603.  
  1604.          Any other event received in the Idle state is ignored.
  1605.  
  1606.       Connect state:
  1607.  
  1608.          In this state BGP is waiting for the transport protocol
  1609.          connection to be completed.
  1610.  
  1611.          If the transport protocol connection succeeds, the local system
  1612.          clears the ConnectRetry timer, completes initialization, sends
  1613.          an OPEN message to its peer, and changes its state to OpenSent.
  1614.  
  1615.          If the transport protocol connect fails (e.g., retransmission
  1616.  
  1617.  
  1618.  
  1619. Expiration Date October 1993                                   [Page 29]
  1620.  
  1621. INTERNET DRAFT                                                April 1993
  1622.  
  1623.  
  1624.          timeout), the local system restarts the ConnectRetry timer,
  1625.          continues to listen for a connection that may be initiated by
  1626.          the remote BGP peer, and changes its state to Active state.
  1627.  
  1628.          In response to the ConnectRetry timer expired event, the local
  1629.          system restarts the ConnectRetry timer, initiates a transport
  1630.          connection to other BGP peer, continues to listen for a
  1631.          connection that may be initiated by the remote BGP peer, and
  1632.          stays in the Connect state.
  1633.  
  1634.          Start event is ignored in the Active state.
  1635.  
  1636.          In response to any other event (initiated by either system or
  1637.          operator), the local system releases all BGP resources
  1638.          associated with this connection and changes its state to Idle.
  1639.  
  1640.       Active state:
  1641.  
  1642.          In this state BGP is trying to acquire a BGP neighbor by
  1643.          initiating a transport protocol connection.
  1644.  
  1645.          If the transport protocol connection succeeds, the local system
  1646.          clears the ConnectRetry timer, completes initialization, sends
  1647.          an OPEN message to its peer, sets its hold timer to a large
  1648.          value, and changes its state to OpenSent.
  1649.  
  1650.          In response to the ConnectRetry timer expired event, the local
  1651.          system restarts the ConnectRetry timer, initiates a transport
  1652.          connection to other BGP peer, continues to listen for a
  1653.          connection that may be initiated by the remote BGP peer, and
  1654.          changes its state to Connect.
  1655.  
  1656.          If the local system detects that a remote peer is trying to
  1657.          establish BGP connection to it, and the IP address of the
  1658.          remote peer is not an expected one, the local system restarts
  1659.          the ConnectRetry timer, rejects the attempted connection,
  1660.          continues to listen for a connection that may be initiated by
  1661.          the remote BGP peer, and stays in the Active state.
  1662.  
  1663.          Start event is ignored in the Active state.
  1664.  
  1665.          In response to any other event (initiated by either system or
  1666.          operator), the local system releases all BGP resources
  1667.          associated with this connection and changes its state to Idle.
  1668.  
  1669.       OpenSent state:
  1670.  
  1671.          In this state BGP waits for an OPEN message from its peer.
  1672.  
  1673.  
  1674.  
  1675. Expiration Date October 1993                                   [Page 30]
  1676.  
  1677. INTERNET DRAFT                                                April 1993
  1678.  
  1679.  
  1680.          When an OPEN message is received, all fields are checked for
  1681.          correctness.  If the BGP message header checking or OPEN
  1682.          message checking detects an error (see Section 6.2), or a
  1683.          connection collision (see Section 6.8) the local system sends a
  1684.          NOTIFICATION message and changes its state to Idle.
  1685.  
  1686.          If there are no errors in the OPEN message, BGP sends a
  1687.          KEEPALIVE message and sets a KeepAlive timer.  The hold timer,
  1688.          which was originally set to an arbitrary large value (see
  1689.          above), is replaced with the value indicated in the OPEN
  1690.          message. If the value of the Autonomous System field is the
  1691.          same as our own, then the connection is "internal" connection;
  1692.          otherwise, it is "external".  (This will effect UPDATE
  1693.          processing as described below.) Finally, the state is changed
  1694.          to OpenConfirm.
  1695.  
  1696.          If a disconnect notification is received from the underlying
  1697.          transport protocol, the local system closes the BGP connection,
  1698.          restarts the ConnectRetry timer, while continue listening for
  1699.          connection that may be initiated by the remote BGP peer, and
  1700.          goes into the Active state.
  1701.  
  1702.          If the hold time expires, the local system sends NOTIFICATION
  1703.          message with error code Hold Timer Expired and changes its
  1704.          state to Idle.
  1705.  
  1706.          In response to the Stop event (initiated by either system or
  1707.          operator) the local system sends NOTIFICATION message with
  1708.          Error Code Cease and changes its state to Idle.
  1709.  
  1710.          Start event is ignored in the OpenSent state.
  1711.  
  1712.          In response to any other event the local system sends
  1713.          NOTIFICATION message with Error Code Finite State Machine Error
  1714.          and changes its state to Idle.
  1715.  
  1716.          Whenever BGP changes its state from OpenSent to Idle, it closes
  1717.          the BGP (and transport-level) connection and releases all
  1718.          resources associated with that connection.
  1719.  
  1720.       OpenConfirm state:
  1721.  
  1722.          In this state BGP waits for a KEEPALIVE or NOTIFICATION
  1723.          message.
  1724.  
  1725.          If the local system receives a KEEPALIVE message, it changes
  1726.          its state to Established.
  1727.  
  1728.  
  1729.  
  1730.  
  1731. Expiration Date October 1993                                   [Page 31]
  1732.  
  1733. INTERNET DRAFT                                                April 1993
  1734.  
  1735.  
  1736.          If the hold timer expires before a KEEPALIVE message is
  1737.          received, the local system sends NOTIFICATION message with
  1738.          error code Hold Timer expired and changes its state to Idle.
  1739.  
  1740.          If the local system receives a NOTIFICATION message, it changes
  1741.          its state to Idle.
  1742.  
  1743.          If the KeepAlive timer expires, the local system sends a
  1744.          KEEPALIVE message and restarts its KeepAlive timer.
  1745.  
  1746.          If a disconnect notification is received from the underlying
  1747.          transport protocol, the local system changes its state to Idle.
  1748.  
  1749.          In response to the Stop event (initiated by either system or
  1750.          operator) the local system sends NOTIFICATION message with
  1751.          Error Code Cease and changes its state to Idle.
  1752.  
  1753.          Start event is ignored in the OpenConfirm state.
  1754.  
  1755.          In response to any other event the local system sends
  1756.          NOTIFICATION message with Error Code Finite State Machine Error
  1757.          and changes its state to Idle.
  1758.  
  1759.          Whenever BGP changes its state from OpenConfirm to Idle, it
  1760.          closes the BGP (and transport-level) connection and releases
  1761.          all resources associated with that connection.
  1762.  
  1763.       Established state:
  1764.  
  1765.          In the Established state BGP can exchange UPDATE, NOTIFICATION,
  1766.          and KEEPALIVE messages with its peer.
  1767.  
  1768.          If the local system receives an UPDATE or KEEPALIVE message, it
  1769.          restarts its Holdtime timer.
  1770.  
  1771.          If the local system receives a NOTIFICATION message, it changes
  1772.          its state to Idle.
  1773.  
  1774.          If the local system receives an UPDATE message and the UPDATE
  1775.          message error handling procedure (see Section 6.3) detects an
  1776.          error, the local system sends a NOTIFICATION message and
  1777.          changes its state to Idle.
  1778.  
  1779.          If a disconnect notification is received from the underlying
  1780.          transport protocol, the local system changes its state to Idle.
  1781.  
  1782.          If the Holdtime timer expires, the local system sends a
  1783.          NOTIFICATION message with Error Code Hold Timer Expired and
  1784.  
  1785.  
  1786.  
  1787. Expiration Date October 1993                                   [Page 32]
  1788.  
  1789. INTERNET DRAFT                                                April 1993
  1790.  
  1791.  
  1792.          changes its state to Idle.
  1793.  
  1794.          If the KeepAlive timer expires, the local system sends a
  1795.          KEEPALIVE message and restarts its KeepAlive timer.
  1796.  
  1797.          Each time the local system sends a KEEPALIVE or UPDATE message,
  1798.          it restarts its KeepAlive timer.
  1799.  
  1800.          In response to the Stop event (initiated by either system or
  1801.          operator), the local system sends a NOTIFICATION message with
  1802.          Error Code Cease and changes its state to Idle.
  1803.  
  1804.          Start event is ignored in the Established state.
  1805.  
  1806.          In response to any other event, the local system sends
  1807.          NOTIFICATION message with Error Code Finite State Machine Error
  1808.          and changes its state to Idle.
  1809.  
  1810.          Whenever BGP changes its state from Established to Idle, it
  1811.          closes the BGP (and transport-level) connection, releases all
  1812.          resources associated with that connection, and deletes all
  1813.          routes derived from that connection.
  1814.  
  1815.  
  1816. 9.  UPDATE Message Handling
  1817.  
  1818.  
  1819.    An UPDATE message may be received only in the Established state.
  1820.    When an UPDATE message is received, each field is checked for
  1821.    validity as specified in Section 6.3.
  1822.  
  1823.    If an optional non-transitive attribute is unrecognized, it is
  1824.    quietly ignored.  If an optional transitive attribute is
  1825.    unrecognized, the Partial bit (the third high-order bit) in the
  1826.    attribute flags octet is set to 1, and the attribute is retained for
  1827.    propagation to other BGP speakers.
  1828.  
  1829.    If an optional attribute is recognized, and has a valid value, then,
  1830.    depending on the type of the optional attribute, it is processed
  1831.    locally, retained, and updated, if necessary, for possible
  1832.    propagation to other BGP speakers.
  1833.  
  1834.  
  1835.    If the UPDATE message contains a non-empty WITHDRAWN ROUTES field,
  1836.    the previously advertised routes whose  destinations (expressed as IP
  1837.    prefixes) contained in this field shall be removed from the Adj-RIB-
  1838.    In.  This BGP speaker shall run its Decision Process since the
  1839.    previously advertised route is not longer available for use.
  1840.  
  1841.  
  1842.  
  1843. Expiration Date October 1993                                   [Page 33]
  1844.  
  1845. INTERNET DRAFT                                                April 1993
  1846.  
  1847.  
  1848.    If the UPDATE message contains a feasible route, it shall be placed
  1849.    in the appropriate Adj-RIB-In, and the following additional actions
  1850.    shall be taken:
  1851.  
  1852.    i) If its Network Layer Reachability Information (NLRI) is identical
  1853.    to the one of a route currently stored in the Adj-RIB-In, then the
  1854.    new route shall replace the older route in the Adj-RIB-In, thus
  1855.    implicitly withdrawing the older route from service. The BGP speaker
  1856.    shall run its Decision Process since the older route is no longer
  1857.    available for use.
  1858.  
  1859.    ii) If the new route is an overlapping route that is included (see
  1860.    9.1.4) in an earlier route contained in the Adj-RIB-In, the BGP
  1861.    speaker shall run its Decision Process since the more specific route
  1862.    has implicitly made a portion of the less specific route unavailable
  1863.    for use.
  1864.  
  1865.    iii) If the new route has identical path attributes to an earlier
  1866.    route contained in the Adj-RIB-In, and is more specific (see 9.1.4)
  1867.    than the earlier route, no further actions are necessary.
  1868.  
  1869.    iv) If the new route has NLRI that is not present in any of the
  1870.    routes currently stored in the Adj-RIB-In, then the new route shall
  1871.    be placed in the Adj-RIB-In. The BGP speaker shall run its Decision
  1872.    Process.
  1873.  
  1874.    v) If the new route is an overlapping route that is less specific
  1875.    (see 9.1.4) than an earlier route contained in the Adj-RIB-In, the
  1876.    BGP speaker shall run its Decision Process on the set of destinations
  1877.    described only by the less specific route.
  1878.  
  1879.  
  1880. 9.1 Decision Process
  1881.  
  1882.  
  1883.    The Decision Process selects routes for subsequent advertisement by
  1884.    applying the policies in the local Policy Information Base (PIB) to
  1885.    the routes stored in its Adj-RIB-In. The output of the Decision
  1886.    Process is the set of routes that will be advertised to adjacent BGP
  1887.    speakers; the selected routes will be stored in the local speaker's
  1888.    Adj-RIB-Out.
  1889.  
  1890.    The selection process is formalized by defining a function that takes
  1891.    the attribute of a given route as an argument and returns a non-
  1892.    negative integer denoting the degree of preference for the route.
  1893.    The function that calculates the degree of preference for a given
  1894.    route shall not use as its inputs any of the following: the existence
  1895.    of other routes, the non-existence of other routes, or the path
  1896.  
  1897.  
  1898.  
  1899. Expiration Date October 1993                                   [Page 34]
  1900.  
  1901. INTERNET DRAFT                                                April 1993
  1902.  
  1903.  
  1904.    attributes of other routes. Route selection then consists of
  1905.    individual application of the degree of preference function to each
  1906.    feasible route, followed by the choice of the one with the highest
  1907.    degree of preference.
  1908.  
  1909.    The Decision Process operates on routes contained in each Adj-RIB-In,
  1910.    and is responsible for:
  1911.  
  1912.       - selection of routes to be advertised to BGP speakers located in
  1913.       the local speaker's autonomous system
  1914.  
  1915.       - selection of routes to be advertised to BGP speakers located in
  1916.       adjacent autonomous systems
  1917.  
  1918.       - route aggregation and route information reduction
  1919.  
  1920.    The Decision Process takes place in three distinct phases, each
  1921.    triggered by a different event:
  1922.  
  1923.       a) Phase 1 is responsible for calculating the degree of preference
  1924.       for each route received from a BGP speaker located in an adjacent
  1925.       autonomous system, and for advertising to the other BGP speakers
  1926.       in the local autonomous system the routes that have the highest
  1927.       degree of preference for each distinct destination.
  1928.  
  1929.       b) Phase 2 is invoked on completion of phase 1. It is responsible
  1930.       for choosing the best route out of all those available for each
  1931.       distinct destination, and for installing each chosen route into
  1932.       the appropriate Loc-RIB.
  1933.  
  1934.       c) Phase 3 is invoked after the Loc-RIB has been modified. It is
  1935.       responsible for disseminating routes in the Loc-RIB to each
  1936.       adjacent BGP speaker located in an adjacent autonomous system,
  1937.       according to the policies contained in the PIB. Route aggregation
  1938.       and information reduction can optionally be performed within this
  1939.       phase.
  1940.  
  1941.  
  1942. 9.1.1 Phase 1: Calculation of Degree of Preference
  1943.  
  1944.  
  1945.    The Phase 1 decision function shall be invoked whenever the local BGP
  1946.    speaker receives an UPDATE message from a neighboring BGP speaker
  1947.    located in an adjacent autonomous system that advertises a new route,
  1948.    a replacement route, or a withdrawn route.
  1949.  
  1950.    The Phase 1 decision function is a separate process which completes
  1951.    when it has no further work to do.
  1952.  
  1953.  
  1954.  
  1955. Expiration Date October 1993                                   [Page 35]
  1956.  
  1957. INTERNET DRAFT                                                April 1993
  1958.  
  1959.  
  1960.    The Phase 1 decision function shall lock an Adj-RIB-In prior to
  1961.    operating on any route contained within it, and shall unlock it after
  1962.    operating on all new or unfeasible routes contained within it.
  1963.  
  1964.    For each newly received or replacement feasible route, the local BGP
  1965.    speaker shall determine a degree of preference. If the route is
  1966.    learned from a BGP speaker in the local autonomous system, either the
  1967.    value of the LOCAL_PREF attribute shall be taken as the degree of
  1968.    preference, or the local system shall compute the degree of
  1969.    preference of the route based on preconfigured policy information. If
  1970.    the route is learned from a BGP speaker in an adjacent autonomous
  1971.    system, then the degree of preference shall be computed based on
  1972.    preconfigured policy information.  The exact nature of this policy
  1973.    information and the computation involved is a local matter.  The
  1974.    local speaker shall then run the internal update process of 9.2.1 to
  1975.    select and advertise the most preferable route.
  1976.  
  1977.  
  1978. 9.1.2 Phase 2: Route Selection
  1979.  
  1980.  
  1981.    The Phase 2 decision function shall be invoked on completion of Phase
  1982.    1.  The Phase 2 function is a separate process which completes when
  1983.    it has no further work to do. The Phase 2 process shall consider all
  1984.    routes that are present in the Adj-RIBs-In, including those received
  1985.    from BGP speakers located in its own autonomous system and those
  1986.    received from BGP speakers located in adjacent autonomous systems.
  1987.  
  1988.    The Phase 2 decision function shall be blocked from running while the
  1989.    Phase 3 decision function is in process. The Phase 2 function shall
  1990.    lock all Adj-RIBs-In prior to commencing its function, and shall
  1991.    unlock them on completion.
  1992.  
  1993.    For each set of destinations for which a feasible route exists in the
  1994.    Adj-RIBs-In, the local BGP speaker shall identify the route that has:
  1995.  
  1996.       a) the highest degree of preference of any route to the same set
  1997.       of destinations, or
  1998.  
  1999.       b) is the only route to that destination, or
  2000.  
  2001.       c) is selected as a result of the Phase 2 tie breaking rules
  2002.       specified in 9.1.2.1.
  2003.  
  2004.  
  2005.    An alternative procedure for selecting a route may be realized if a
  2006.    BGP speaker can ascertain whether a particular route the speaker
  2007.    wants to select is also present in the interior routing protocol
  2008.  
  2009.  
  2010.  
  2011. Expiration Date October 1993                                   [Page 36]
  2012.  
  2013. INTERNET DRAFT                                                April 1993
  2014.  
  2015.  
  2016.    (IGP) of the autonomous system the speaker belongs to, and that the
  2017.    BGP speaker that injected the route into the IGP has this route
  2018.    installed in its Loc-RIB. A BGP speaker may select a route, provided
  2019.    that the following conditions are satisfied:
  2020.  
  2021.       a) the NLRI of the route is present in the IGP of the autonomous
  2022.       system the speaker belongs to
  2023.  
  2024.       b) the BGP speaker that injected the NLRI into the IGP has the
  2025.       route in its Loc-RIB
  2026.  
  2027.       c) the BGP speaker that injected the NLRI into the IGP  will be
  2028.       used as an exit point by the IGP.
  2029.  
  2030.    The exact procedures for verifying the above conditions are specific
  2031.    to a particular IGP and are outside the scope of this document.
  2032.  
  2033.    The local speaker shall then install that route in the Loc-RIB,
  2034.    replacing any route to the same destination that is currently being
  2035.    held in the Loc-RIB.
  2036.  
  2037.    Unfeasible routes shall be removed from the Loc-RIB, and
  2038.    corresponding unfeasible routes shall then be removed from the Adj-
  2039.    RIBs-In.
  2040.  
  2041.  
  2042. 9.1.2.1 Breaking Ties (Phase 2)
  2043.  
  2044.  
  2045.    In its Adj-RIBs-In a BGP speaker may have several routes to the same
  2046.    destination that have the same degree of preference. The local
  2047.    speaker can select only one of these routes for inclusion in the
  2048.    associated Loc-RIB. The local speaker considers all equally
  2049.    preferable routes, both those received from BGP speakers located in
  2050.    adjacent autonomous systems, and those received from other BGP
  2051.    speakers located in the local speaker's autonomous system.
  2052.  
  2053.    Ties shall be broken according to the following rules:
  2054.  
  2055.       a) If the candidate routes have identical path attributes or
  2056.       differ only in the NEXT_HOP attribute, select the route that was
  2057.       advertised by the BGP speaker in an adjacent autonomous system
  2058.       whose BGP Identifier has the lowest value. If none of the
  2059.       candidate routes were received from a BGP speaker located in an
  2060.       adjacent autonomous system, select the route that was advertised
  2061.       by the BGP speaker in the local autonomous system whose BGP
  2062.       Identifier has the lowest value.
  2063.  
  2064.  
  2065.  
  2066.  
  2067. Expiration Date October 1993                                   [Page 37]
  2068.  
  2069. INTERNET DRAFT                                                April 1993
  2070.  
  2071.  
  2072.       b) If the candidate routes differ only in their NEXT_HOP and
  2073.       MULTI_EXIT_DISC attributes, and the local system is configured to
  2074.       take into account MULTI_EXIT_DISC, select the route that has the
  2075.       lowest value of the MULTI_EXIT_DISC attribute.
  2076.  
  2077.       If the local system is configured to ignore MULTI_EXIT_DISC,
  2078.       select the route advertised by the BGP speaker in an adjacent
  2079.       autonomous system whose BGP Identifier has the lowest value.  If
  2080.       none of the candidate routes were received from a BGP speaker
  2081.       located in an adjacent autonomous system, select the route that
  2082.       was advertised by the BGP speaker in the local autonomous system
  2083.       whose BGP Identifier has the lowest value.
  2084.  
  2085.       c) If the candidate routes differ in any path attributes other
  2086.       than NEXT_HOP and MULTI_EXIT_DISC, and all of the candidate routes
  2087.       were advertised by the BGP speakers within the local autonomous
  2088.       system, select the route that was advertised by the BGP speaker
  2089.       whose BGP identifier has the lowest value.
  2090.  
  2091.       If the candidate routes differ in any path attributes other than
  2092.       NEXT_HOP and MULTI_EXIT_DISC, and all of the candidate routes were
  2093.       advertised by the BGP speakers in adjacent autonomous systems,
  2094.       select the route that was advertised by the BGP speaker whose BGP
  2095.       identifier has the lowest value.
  2096.  
  2097.       If the candidate routes differ in any path attributes other than
  2098.       NEXT_HOP and MULTI_EXIT_DISC, and some of the candidate routes
  2099.       were advertised by the BGP speakers in adjacent autonomous system,
  2100.       while others were advertised by the BGP speakers within the local
  2101.       autonomous system, the local system shall determine the BGP
  2102.       speaker within the local autonomous system whose BGP identifier
  2103.       has the lowest value and is advertising a candidate route
  2104.       (including itself).
  2105.  
  2106.       If this speaker is the local system, then select the route that
  2107.       was advertised by the BGP speaker in an adjacent autonomous system
  2108.       whose BGP identifier has the lowest value among all other BGP
  2109.       speakers in adjacent autonomous systems.
  2110.  
  2111.       Otherwise (if the BGP identifier of the local system is not the
  2112.       lowest among all BGP speakers within the local autonomous system
  2113.       advertising a candidate route), select the route that was
  2114.       advertised by the BGP speaker within the local autonomous system
  2115.       whose BGP identifier has the lowest value.
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123. Expiration Date October 1993                                   [Page 38]
  2124.  
  2125. INTERNET DRAFT                                                April 1993
  2126.  
  2127.  
  2128. 9.1.3   Phase 3: Route Dissemination
  2129.  
  2130.  
  2131.    The Phase 3 decision function shall be invoked on completion of Phase
  2132.    2, or when any of the following events occur:
  2133.  
  2134.       a) when routes in a Loc-RIB to local destinations have changed
  2135.  
  2136.       b) when locally generated routes learned by means outside of BGP
  2137.       have changed
  2138.  
  2139.       c) when a new BGP speaker - BGP speaker connection has been
  2140.       established
  2141.  
  2142.    The Phase 3 function is a separate process which completes when it
  2143.    has no further work to do. The Phase 3 Routing Decision function
  2144.    shall be blocked from running while the Phase 2 decision function is
  2145.    in process.
  2146.  
  2147.    All routes in the Loc-RIB shall be processed into a corresponding
  2148.    entry in the associated Adj-RIBs-Out. Route aggregation and
  2149.    information reduction techniques (see 9.2.4.1) may optionally be
  2150.    applied.
  2151.  
  2152.  
  2153.    For the benefit of future support of inter-AS multicast capabilities,
  2154.    a BGP speaker that participates in the inter-AS multicast shall
  2155.    advertise a route it receives from one of its external peers and
  2156.    installs in its Loc-RIB back to the peer from which the route was
  2157.    received. For a BGP speaker that does not participate in the inter-AS
  2158.    multicast such an advertisement is optional. When doing such an
  2159.    advertisement, the NEXT_HOP attribute should be set to the address of
  2160.    the peer. An implementation may also optimize such an advertisement
  2161.    by truncating information in the AS_PATH attribute to include only
  2162.    its own AS number and that of the peer that advertised the route
  2163.    (such truncation requires the ORIGIN attribute to be set to
  2164.    INCOMPLETE).  In addition an implementation is not required to pass
  2165.    optional or discretionary path attributes with such an advertisement.
  2166.  
  2167.    When the updating of the Adj-RIBs-Out and the Forwarding Information
  2168.    Base (FIB) is complete, the local BGP speaker shall run the external
  2169.    update process of 9.2.2.
  2170.  
  2171.  
  2172. 9.1.4 Overlapping Routes
  2173.  
  2174.  
  2175.    A BGP speaker may transmit routes with overlapping Network Layer
  2176.  
  2177.  
  2178.  
  2179. Expiration Date October 1993                                   [Page 39]
  2180.  
  2181. INTERNET DRAFT                                                April 1993
  2182.  
  2183.  
  2184.    Reachability Information (NLRI) to another BGP speaker. NLRI overlap
  2185.    occurs when a set of destinations are identified in non-matching
  2186.    multiple routes. Since BGP encodes NLRI using IP prefixes, overlap
  2187.    will always exhibit subset relationships.  A route describing a
  2188.    smaller set of destinations (a longer prefix) is said to be more
  2189.    specific than a route describing a larger set of destinations (a
  2190.    shorted prefix); similarly, a route describing a larger set of
  2191.    destinations (a shorter prefix) is said to be less specific than a
  2192.    route describing a smaller set of destinations (a longer prefix).
  2193.  
  2194.    The precedence relationship effectively decomposes less specific
  2195.    routes into two parts:
  2196.  
  2197.       -  a set of destinations described only by the less specific
  2198.       route, and
  2199.  
  2200.       -  a set of destinations described by the overlap of the less
  2201.       specific and the more specific routes
  2202.  
  2203.  
  2204.    When overlapping routes are present in the same Adj-RIB-In, the more
  2205.    specific route shall take precedence, in order from more specific to
  2206.    least specific.
  2207.  
  2208.    The set of destinations described by the overlap represents a portion
  2209.    of the less specific route that is feasible, but is not currently in
  2210.    use.  If a more specific route is later withdrawn, the set of
  2211.    destinations described by the overlap will still be reachable using
  2212.    the less specific route.
  2213.  
  2214.    If a BGP speaker receives overlapping routes, the Decision Process
  2215.    shall take into account the semantics of the overlapping routes. In
  2216.    particular, if a BGP speaker accepts the less specific route while
  2217.    rejecting the more specific route from the same neighbor, then the
  2218.    destinations represented by the overlap may not forward along the ASs
  2219.    listed in the AS_PATH attribute of that route. Therefore, a BGP
  2220.    speaker has the following choices:
  2221.  
  2222.       a)   Install both the less and the more specific routes
  2223.  
  2224.       b)   Install the more specific route only
  2225.  
  2226.       c)   Install the non-overlapping part of the less specific
  2227.                  route only (that implies de-aggregation)
  2228.  
  2229.       d)   Aggregate the two routes and install the aggregated route
  2230.  
  2231.       e)   Install the less specific route only
  2232.  
  2233.  
  2234.  
  2235. Expiration Date October 1993                                   [Page 40]
  2236.  
  2237. INTERNET DRAFT                                                April 1993
  2238.  
  2239.  
  2240.       f)   Install neither route
  2241.  
  2242.    If a BGP speaker chooses e), then it should add ATOMIC_AGGREGATE
  2243.    attribute to the route. A route that carries ATOMIC_AGGREGATE
  2244.    attribute can not be de-aggregated. That is, the NLRI of this route
  2245.    can not be made more specific.  Forwarding along such a route does
  2246.    not guarantee that IP packets will actually traverse only ASs listed
  2247.    in the AS_PATH attribute of the route.  If a BGP speaker chooses a),
  2248.    it must not advertise the more general route without the more
  2249.    specific route.
  2250.  
  2251.  
  2252. 9.2 Update-Send Process
  2253.  
  2254.  
  2255.    The Update-Send process is responsible for advertising UPDATE
  2256.    messages to adjacent BGP speakers. For example, it distributes the
  2257.    routes chosen by the Decision Process to other BGP speakers which may
  2258.    be located in either the same autonomous system or an adjacent
  2259.    autonomous system.  Rules for information exchange between BGP
  2260.    speakers located in different autonomous systems are given in 9.2.2;
  2261.    rules for information exchange between BGP speakers located in the
  2262.    same autonomous system are given in 9.2.1.
  2263.  
  2264.    Distribution of routing information between a set of BGP speakers,
  2265.    all of which are located in the same autonomous system, is referred
  2266.    to as internal distribution.
  2267.  
  2268.  
  2269. 9.2.1 Internal Updates
  2270.  
  2271.  
  2272.    The Internal update process is concerned with the distribution of
  2273.    routing information to BGP speakers located in the local speaker's
  2274.    autonomous system.
  2275.  
  2276.    When a BGP speaker receives an UPDATE message from another BGP
  2277.    speaker located in its own autonomous system, the receiving BGP
  2278.    speaker shall not re-distribute the routing information contained in
  2279.    that UPDATE message to other BGP speakers located in its own
  2280.    autonomous system.
  2281.  
  2282.    When a BGP speaker receives a new route from a BGP speaker in an
  2283.    adjacent autonomous system, it shall advertise that route to all
  2284.    other BGP speakers in its autonomous system by means of an UPDATE
  2285.    message if any of the following conditions occur:
  2286.  
  2287.       1) the degree of preference assigned to the newly received route
  2288.  
  2289.  
  2290.  
  2291. Expiration Date October 1993                                   [Page 41]
  2292.  
  2293. INTERNET DRAFT                                                April 1993
  2294.  
  2295.  
  2296.       by the local BGP speaker is higher than the degree of preference
  2297.       that the local speaker has assigned to other routes that have been
  2298.       received from BGP speakers in adjacent autonomous systems, or
  2299.  
  2300.       2) there are no other routes that have been received from BGP
  2301.       speakers in adjacent autonomous systems, or
  2302.  
  2303.       3) the newly received route is selected as a result of breaking a
  2304.       tie between several routes which have the highest degree of
  2305.       preference, and the same destination.
  2306.  
  2307.    When a BGP speaker receives an UPDATE message with a non-empty
  2308.    WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all
  2309.    routes whose destinations was carried in this field (as IP prefixes).
  2310.    The speaker shall take the following additional steps:
  2311.  
  2312.       1) if the corresponding feasible route had not been previously
  2313.       advertised, then no further action is necessary
  2314.  
  2315.       2) if the corresponding feasible route had been previously
  2316.       advertised, then:
  2317.  
  2318.          i) if a new route is selected for advertisement that has the
  2319.          same Network Layer Reachability Information as the unfeasible
  2320.          routes, then the local BGP speaker shall advertise the
  2321.          replacement route
  2322.  
  2323.          ii) if a replacement route is not available for advertisement,
  2324.          then the BGP speaker shall include the destinations  of the
  2325.          unfeasible route (in form of IP prefixes) in the WITHDRAWN
  2326.          ROUTES field of an UPDATE message, and shall send this message
  2327.          to each neighbor BGP speaker to whom it had previously
  2328.          advertised the corresponding feasible route.
  2329.  
  2330.  
  2331.    All feasible routes which are advertised shall be placed in the
  2332.    appropriate Adj-RIBs-Out, and all unfeasible routes which are
  2333.    advertised shall be removed from the Adj-RIBs-Out.
  2334.  
  2335.  
  2336. 9.2.1.1 Breaking Ties (Internal Updates)
  2337.  
  2338.  
  2339.    If a local BGP speaker has connections to several BGP speakers in
  2340.    adjacent autonomous systems, there will be multiple Adj-RIBs-In
  2341.    associated with these neighbors. These Adj-RIBs-In might contain
  2342.    several equally preferable routes to the same destination, all of
  2343.    which were advertised by BGP speakers located in adjacent autonomous
  2344.  
  2345.  
  2346.  
  2347. Expiration Date October 1993                                   [Page 42]
  2348.  
  2349. INTERNET DRAFT                                                April 1993
  2350.  
  2351.  
  2352.    systems. The local BGP speaker shall select one of these routes
  2353.    according to the following rules:
  2354.  
  2355.       a) If the candidate route differ only in their NEXT_HOP and
  2356.       MULTI_EXIT_DISC attributes, and the local system is configured to
  2357.       take into account MULTI_EXIT_DISC attribute, select the routes
  2358.       that has the lowest value of the MULTI_EXIT_DISC attribute.
  2359.  
  2360.       b) In all other cases, select the route that was advertised by the
  2361.       BGP speaker whose BGP Identifier has the lowest value.
  2362.  
  2363.  
  2364.  
  2365. 9.2.2 External Updates
  2366.  
  2367.  
  2368.    The external update process is concerned with the distribution of
  2369.    routing information to BGP speakers located in adjacent autonomous
  2370.    systems. As part of Phase 3 route selection process, the BGP speaker
  2371.    has updated its Adj-RIBs-Out and its Forwarding Table. All newly
  2372.    installed routes and all newly unfeasible routes for which there is
  2373.    no replacement route shall be advertised to BGP speakers located in
  2374.    adjacent autonomous systems by means of UPDATE message.
  2375.  
  2376.    Any routes in the Loc-RIB marked as unfeasible shall be removed.
  2377.    Changes to the reachable destinations within its own autonomous
  2378.    system shall also be advertised in an UPDATE message.
  2379.  
  2380.  
  2381. 9.2.3 Controlling Routing Traffic Overhead
  2382.  
  2383.  
  2384.    The BGP protocol constrains the amount of routing traffic (that is,
  2385.    UPDATE messages) in order to limit both the link bandwidth needed to
  2386.    advertise UPDATE messages and the processing power needed by the
  2387.    Decision Process to digest the information contained in the UPDATE
  2388.    messages.
  2389.  
  2390.  
  2391. 9.2.3.1 Frequency of Route Advertisement
  2392.  
  2393.  
  2394.    The parameter MinRouteAdvertisementInterval determines the minimum
  2395.    amount of time that must elapse between advertisement of routes to a
  2396.    particular destination from a single BGP speaker. This rate limiting
  2397.    procedure applies on a per-destination basis, although the value of
  2398.    MinRouteAdvertisementInterval is set on a per BGP peer basis.
  2399.  
  2400.  
  2401.  
  2402.  
  2403. Expiration Date October 1993                                   [Page 43]
  2404.  
  2405. INTERNET DRAFT                                                April 1993
  2406.  
  2407.  
  2408.    Two UPDATE messages sent from a single BGP speaker that advertise
  2409.    feasible routes to some common set of destinations received from BGP
  2410.    speakers in adjacent autonomous systems must be separated by at least
  2411.    MinRouteAdvertisementInterval. Clearly, this can only be achieved
  2412.    precisely by keeping a separate timer for each common set of
  2413.    destinations. This would be unwarranted overhead. Any technique which
  2414.    ensures that the interval between two UPDATE messages sent from a
  2415.    single BGP speaker that advertise feasible routes to some common set
  2416.    of destinations received from BGP speakers in adjacent autonomous
  2417.    systems will be at least MinRouteAdvertisementInterval, and will also
  2418.    ensure a constant upper bound on the interval is acceptable.
  2419.  
  2420.    Since fast convergence is needed within an autonomous system, this
  2421.    procedure does not apply for routes receives from other BGP speakers
  2422.    in the same autonomous system. To avoid long-lived black holes, the
  2423.    procedure does not apply to the explicit withdrawal of unfeasible
  2424.    routes (that is, routes whose destinations (expressed as IP prefixes)
  2425.    are listed in the WITHDRAWN ROUTES field of an UPDATE message).
  2426.  
  2427.    This procedure does not limit the rate of route selection, but only
  2428.    the rate of route advertisement. If new routes are selected multiple
  2429.    times while awaiting the expiration of MinRouteAdvertisementInterval,
  2430.    the last route selected shall be advertised at the end of
  2431.    MinRouteAdvertisementInterval.
  2432.  
  2433.  
  2434. 9.2.3.2 Frequency of Route Origination
  2435.  
  2436.  
  2437.    The parameter MinASOriginationInterval determines the minimum amount
  2438.    of time that must elapse between successive advertisements of UPDATE
  2439.    messages that report changes within the advertising BGP speaker's own
  2440.    autonomous systems.
  2441.  
  2442.  
  2443. 9.2.3.3 Jitter
  2444.  
  2445.  
  2446.    To minimize the likelihood that the distribution of BGP messages by a
  2447.    given BGP speaker will contain peaks, jitter should be applied to the
  2448.    timers associated with MinASOriginationInterval, Keepalive, and
  2449.    MinRouteAdvertisementInterval. A given BGP speaker shall apply the
  2450.    same jitter to each of these quantities regardless of the
  2451.    destinations to which the updates are being sent; that is, jitter
  2452.    will not be applied on a "per peer" basis.
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459. Expiration Date October 1993                                   [Page 44]
  2460.  
  2461. INTERNET DRAFT                                                April 1993
  2462.  
  2463.  
  2464. 9.2.4 Efficient Organization of Routing Information
  2465.  
  2466.  
  2467.    Having selected the routing information which it will advertise, a
  2468.    BGP speaker may avail itself of several methods to organize this
  2469.    information in an efficient manner.
  2470.  
  2471.  
  2472. 9.2.4.1 Information Reduction
  2473.  
  2474.  
  2475.    Information reduction may imply a reduction in granularity of policy
  2476.    control - after information is collapsed, the same policies will
  2477.    apply to all destinations and paths in the equivalence class.
  2478.  
  2479.    The Decision Process may optionally reduce the amount of information
  2480.    that it will place in the Adj-RIBs-Out by any of the following
  2481.    methods:
  2482.  
  2483.       a)   Network Layer Reachability Information (NLRI):
  2484.  
  2485.       Destination IP addresses can be represented as IP address
  2486.       prefixes.  In cases where there is a correspondence between the
  2487.       address structure and the systems under control of an autonomous
  2488.       system administrator, it will be possible to reduce the size of
  2489.       the NLRI carried in the UPDATE messages.
  2490.  
  2491.       b)   AS_PATHs:
  2492.  
  2493.       AS path information can be represented as ordered AS_SEQUENCEs or
  2494.       unordered AS_SETs. AS_SETs are used in the route aggregation
  2495.       algorithm described in 9.2.4.2. They reduce the size of the
  2496.       AS_PATH information by listing each AS number only once,
  2497.       regardless of how many times it may have appeared in multiple
  2498.       AS_PATHs that were aggregated.
  2499.  
  2500.       An AS_SET implies that the destinations listed in the NLRI can be
  2501.       reached through paths that traverse at least some of the
  2502.       constituent autonomous systems. AS_SETs provide sufficient
  2503.       information to avoid routing information looping; however their
  2504.       use may prune potentially feasible paths, since such paths are no
  2505.       longer listed individually as in the form of AS_SEQUENCEs.  In
  2506.       practice this is not likely to be a problem, since once an IP
  2507.       packet arrives at the edge of a group of autonomous systems, the
  2508.       BGP speaker at that point is likely to have more detailed path
  2509.       information and can distinguish individual paths to destinations.
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515. Expiration Date October 1993                                   [Page 45]
  2516.  
  2517. INTERNET DRAFT                                                April 1993
  2518.  
  2519.  
  2520. 9.2.4.2 Aggregating Routing Information
  2521.  
  2522.  
  2523.    Aggregation is the process of combining the characteristics of
  2524.    several different routes in such a way that a single route can be
  2525.    advertised.  Aggregation can occur as part of the decision  process
  2526.    to reduce the amount of routing information that will be placed in
  2527.    the Adj-RIBs-Out.
  2528.  
  2529.    Aggregation reduces the amount of information that a BGP speaker must
  2530.    store and exchange with other BGP speakers. Routes can be aggregated
  2531.    by applying the following procedure separately to path attributes of
  2532.    like type and to the Network Layer Reachability Information.
  2533.  
  2534.    Routes that have the following attributes shall not be aggregated
  2535.    unless the corresponding attributes of each route are identical:
  2536.    MULTI_EXIT_DISC, NEXT_HOP.
  2537.  
  2538.    Path attributes that have different type codes can not be aggregated
  2539.    together. Path of the same type code may be aggregated, according to
  2540.    the following rules:
  2541.  
  2542.       ORIGIN attribute: If at least one route among routes that are
  2543.       aggregated has ORIGIN with the value INCOMPLETE, then the
  2544.       aggregated route must have the ORIGIN attribute with the value
  2545.       INCOMPLETE. Otherwise, if at least one route among routes that are
  2546.       aggregated has ORIGIN with the value EGP, then the aggregated
  2547.       route must have the origin attribute with the value EGP. In all
  2548.       other case the value of the ORIGIN attribute of the aggregated
  2549.       route is INTERNAL.
  2550.  
  2551.       AS_PATH attribute: If routes to be aggregated have identical
  2552.       AS_PATH attributes, then the aggregated route has the same AS_PATH
  2553.       attribute as each individual route.
  2554.  
  2555.       For the purpose of aggregating AS_PATH attributes we model each AS
  2556.       within the AS_PATH attribute as a tuple <type, value>, where
  2557.       "type" identifies a type of the path segment the AS belongs to
  2558.       (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number.  If the
  2559.       routes to be aggregated have different AS_PATH attributes, then
  2560.       the aggregated AS_PATH attribute shall satisfy all of the
  2561.       following conditions:
  2562.  
  2563.          - all tuples of the type AS_SEQUENCE in the aggregated AS_PATH
  2564.          shall appear in all of the AS_PATH in the initial set of routes
  2565.          to be aggregated.
  2566.  
  2567.          - all tuples of the type AS_SET in the aggregated AS_PATH shall
  2568.  
  2569.  
  2570.  
  2571. Expiration Date October 1993                                   [Page 46]
  2572.  
  2573. INTERNET DRAFT                                                April 1993
  2574.  
  2575.  
  2576.          appear in at least one of the AS_PATH in the initial set (they
  2577.          may appear as either AS_SET or AS_SEQUENCE types).
  2578.  
  2579.          - for any tuple X of the type AS_SEQUENCE in the aggregated
  2580.          AS_PATH which precedes tuple Y in the aggregated AS_PATH, X
  2581.          precedes Y in each AS_PATH in the initial set which contains Y,
  2582.          regardless of the type of Y.
  2583.  
  2584.          - No tuple with the same value shall appear more than once in
  2585.          the aggregated AS_PATH, regardless of the tuple's type.
  2586.  
  2587.       An implementation may choose any algorithm which conforms to these
  2588.       rules.  At a minimum a conformant implementation shall be able to
  2589.       perform the following algorithm that meets all of the above
  2590.       conditions:
  2591.  
  2592.          - determine the longest leading sequence of tuples (as defined
  2593.          above) common to all the AS_PATH attributes of the routes to be
  2594.          aggregated. Make this sequence the leading sequence of the
  2595.          aggregated AS_PATH attribute.
  2596.  
  2597.          - set the type of the rest of the tuples from the AS_PATH
  2598.          attributes of the routes to be aggregated to AS_SET, and append
  2599.          them to the aggregated AS_PATH attribute.
  2600.  
  2601.          - if the aggregated AS_PATH has more than one tuple with the
  2602.          same value (regardless of tuple's type), eliminate all, but one
  2603.          such tuple by deleting tuples of the type AS_SET from the
  2604.          aggregated AS_PATH attribute.
  2605.  
  2606.       Appendix 6, section 6.8 presents another algorithm that satisfies
  2607.       the conditions and  allows for more complex policy configurations.
  2608.  
  2609.       ATOMIC_AGGREGATE: If at least one of the routes to be aggregated
  2610.       has ATOMIC_AGGREGATE path attribute, then the aggregated route
  2611.       shall have this attribute as well.
  2612.  
  2613.       AGGREGATOR: All AGGREGATOR attributes of all routes to be
  2614.       aggregated should be ignored.
  2615.  
  2616.  
  2617. 9.3.6   Route Selection Criteria
  2618.  
  2619.  
  2620.    Generally speaking, the rules for comparing routes among several
  2621.    alternatives are outside the scope of this document.  There are two
  2622.    exceptions:
  2623.  
  2624.  
  2625.  
  2626.  
  2627. Expiration Date October 1993                                   [Page 47]
  2628.  
  2629. INTERNET DRAFT                                                April 1993
  2630.  
  2631.  
  2632.       - If the local AS appears in the AS path of the new route being
  2633.       considered, then that new route cannot be viewed as better than
  2634.       any other route.  If such a route were ever used, a routing loop
  2635.       would result.
  2636.  
  2637.       - In order to achieve successful distributed operation, only
  2638.       routes with a likelihood of stability can be chosen.  Thus, an AS
  2639.       must avoid using unstable routes, and it must not make rapid
  2640.       spontaneous changes to its choice of route.  Quantifying the terms
  2641.       "unstable" and "rapid" in the previous sentence will require
  2642.       experience, but the principle is clear.
  2643.  
  2644.  
  2645. Appendix 1.  BGP FSM State Transitions and Actions.
  2646.  
  2647.  
  2648.    This Appendix discusses the transitions between states in the BGP FSM
  2649.    in response to BGP events.  The following is the list of these states
  2650.    and events.
  2651.  
  2652.        BGP States:
  2653.  
  2654.                 1 - Idle
  2655.                 2 - Connect
  2656.                 3 - Active
  2657.                 4 - OpenSent
  2658.                 5 - OpenConfirm
  2659.                 6 - Established
  2660.  
  2661.  
  2662.        BGP Events:
  2663.  
  2664.                 1 - BGP Start
  2665.                 2 - BGP Stop
  2666.                 3 - BGP Transport connection open
  2667.                 4 - BGP Transport connection closed
  2668.                 5 - BGP Transport connection open failed
  2669.                 6 - BGP Transport fatal error
  2670.                 7 - ConnectRetry timer expired
  2671.                 8 - Holdtime timer expired
  2672.                 9 - KeepAlive timer expired
  2673.                10 - Receive OPEN message
  2674.                11 - Receive KEEPALIVE message
  2675.                12 - Receive UPDATE messages
  2676.                13 - Receive NOTIFICATION message
  2677.  
  2678.    The following table describes the state transitions of the BGP FSM
  2679.    and the actions triggered by these transitions.
  2680.  
  2681.  
  2682.  
  2683. Expiration Date October 1993                                   [Page 48]
  2684.  
  2685. INTERNET DRAFT                                                April 1993
  2686.  
  2687.  
  2688.        Event                Actions               Message Sent   Next State
  2689.        --------------------------------------------------------------------
  2690.        Idle (1)
  2691.         1            Initialize resources            none             2
  2692.                      Start ConnectRetry timer
  2693.                      Initiate a transport connection
  2694.         others               none                    none             1
  2695.  
  2696.        Connect(2)
  2697.         1                    none                    none             2
  2698.         3            Complete initialization         OPEN             4
  2699.                      Clear ConnectRetry timer
  2700.         5            Restart ConnectRetry timer      none             3
  2701.         7            Restart ConnectRetry timer      none             2
  2702.                      Initiate a transport connection
  2703.         others       Release resources               none             1
  2704.  
  2705.        Active (3)
  2706.         1                    none                    none             3
  2707.         3            Complete initialization         OPEN             4
  2708.                      Clear ConnectRetry timer
  2709.         5            Close connection                                 3
  2710.                      Restart ConnectRetry timer
  2711.         7            Restart ConnectRetry timer      none             2
  2712.                      Initiate a transport connection
  2713.         others       Release resources               none             1
  2714.  
  2715.        OpenSent(4)
  2716.         1                    none                    none             4
  2717.         4            Close transport connection      none             3
  2718.                      Restart ConnectRetry timer
  2719.         6            Release resources               none             1
  2720.        10            Process OPEN is OK            KEEPALIVE          5
  2721.                      Process OPEN failed           NOTIFICATION       1
  2722.        others        Close transport connection    NOTIFICATION       1
  2723.                      Release resources
  2724.  
  2725.        OpenConfirm (5)
  2726.         1                   none                     none             5
  2727.         4            Release resources               none             1
  2728.         6            Release resources               none             1
  2729.         9            Restart KeepAlive timer       KEEPALIVE          5
  2730.        11            Complete initialization         none             6
  2731.                      Restart Holdtime timer
  2732.        13            Close transport connection                       1
  2733.                      Release resources
  2734.        others        Close transport connection    NOTIFICATION       1
  2735.                      Release resources
  2736.  
  2737.  
  2738.  
  2739. Expiration Date October 1993                                   [Page 49]
  2740.  
  2741. INTERNET DRAFT                                                April 1993
  2742.  
  2743.  
  2744.        Established (6)
  2745.         1                   none                     none             6
  2746.         4            Release resources               none             1
  2747.         6            Release resources               none             1
  2748.         9            Restart KeepAlive timer       KEEPALIVE          6
  2749.        11            Restart Holdtime timer        KEEPALIVE          6
  2750.        12            Process UPDATE is OK          UPDATE             6
  2751.                      Process UPDATE failed         NOTIFICATION       1
  2752.        13            Close transport connection                       1
  2753.                      Release resources
  2754.        others        Close transport connection    NOTIFICATION       1
  2755.                      Release resources
  2756.       ---------------------------------------------------------------------
  2757.  
  2758.  
  2759.       The following is a condensed version of the above state transition
  2760.       table.
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.    Events| Idle | Connect | Active | OpenSent | OpenConfirm | Estab
  2767.          | (1)  |   (2)   |  (3)   |    (4)   |     (5)     |   (6)
  2768.          |---------------------------------------------------------------
  2769.     1    |  2   |    2    |   3    |     4    |      5      |    6
  2770.          |      |         |        |          |             |
  2771.     2    |  1   |    1    |   1    |     1    |      1      |    1
  2772.          |      |         |        |          |             |
  2773.     3    |  1   |    4    |   4    |     1    |      1      |    1
  2774.          |      |         |        |          |             |
  2775.     4    |  1   |    1    |   1    |     3    |      1      |    1
  2776.          |      |         |        |          |             |
  2777.     5    |  1   |    3    |   3    |     1    |      1      |    1
  2778.          |      |         |        |          |             |
  2779.     6    |  1   |    1    |   1    |     1    |      1      |    1
  2780.          |      |         |        |          |             |
  2781.     7    |  1   |    2    |   2    |     1    |      1      |    1
  2782.          |      |         |        |          |             |
  2783.     8    |  1   |    1    |   1    |     1    |      1      |    1
  2784.          |      |         |        |          |             |
  2785.     9    |  1   |    1    |   1    |     1    |      5      |    6
  2786.          |      |         |        |          |             |
  2787.    10    |  1   |    1    |   1    |  1 or 5  |      1      |    1
  2788.          |      |         |        |          |             |
  2789.    11    |  1   |    1    |   1    |     1    |      6      |    6
  2790.          |      |         |        |          |             |
  2791.    12    |  1   |    1    |   1    |     1    |      1      | 1 or 6
  2792.  
  2793.  
  2794.  
  2795. Expiration Date October 1993                                   [Page 50]
  2796.  
  2797. INTERNET DRAFT                                                April 1993
  2798.  
  2799.  
  2800.          |      |         |        |          |             |
  2801.    13    |  1   |    1    |   1    |     1    |      1      |    1
  2802.          |      |         |        |          |             |
  2803.          ---------------------------------------------------------------
  2804.  
  2805.  
  2806.  
  2807.  
  2808. Appendix 2. Comparison with RFC1267
  2809.  
  2810.  
  2811.    BGP-4 is capable of operating in an environment where a set of
  2812.    reachable destinations may be expressed via a single IP prefix.  The
  2813.    concept of network classes, or subnetting is foreign to BGP-4.  To
  2814.    accommodate these capabilities BGP-4 changes semantics and encoding
  2815.    associated with the AS_PATH attribute. New text has been added to
  2816.    define semantics associated with IP prefixes.  These abilities allow
  2817.    BGP-4 to support the proposed supernetting scheme [9].
  2818.  
  2819.    To simplify configuration this version introduces a new attribute,
  2820.    LOCAL_PREF, that facilitates route selection procedures.
  2821.  
  2822.    The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC.
  2823.    A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that
  2824.    certain aggregates are not de-aggregated.  Another new attribute,
  2825.    AGGREGATOR, can be added to aggregate routes in order to advertise
  2826.    which AS caused the aggregation.
  2827.  
  2828. Appendix 3.  Comparison with RFC 1163
  2829.  
  2830.  
  2831.    All of the changes listed in Appendix 2, plus the following.
  2832.  
  2833.    To detect and recover from BGP connection collision, a new field (BGP
  2834.    Identifier) has been added to the OPEN message. New text (Section
  2835.    6.8) has been added to specify the procedure for detecting and
  2836.    recovering from collision.
  2837.  
  2838.    The new document no longer restricts the border router that is passed
  2839.    in the NEXT_HOP path attribute to be part of the same Autonomous
  2840.    System as the BGP Speaker.
  2841.  
  2842.    New document optimizes and simplifies the exchange of the information
  2843.    about previously reachable routes.
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851. Expiration Date October 1993                                   [Page 51]
  2852.  
  2853. INTERNET DRAFT                                                April 1993
  2854.  
  2855.  
  2856. Appendix 4.  Comparison with RFC 1105
  2857.  
  2858.  
  2859.    All of the changes listed in Appendices 2 and 3, plus the following.
  2860.  
  2861.    Minor changes to the RFC1105 Finite State Machine were necessary to
  2862.    accommodate the TCP user interface provided by 4.3 BSD.
  2863.  
  2864.    The notion of Up/Down/Horizontal relations present in RFC1105 has
  2865.    been removed from the protocol.
  2866.  
  2867.    The changes in the message format from RFC1105 are as follows:
  2868.  
  2869.       1.  The Hold Time field has been removed from the BGP header and
  2870.       added to the OPEN message.
  2871.  
  2872.       2.  The version field has been removed from the BGP header and
  2873.       added to the OPEN message.
  2874.  
  2875.       3.  The Link Type field has been removed from the OPEN message.
  2876.  
  2877.       4.  The OPEN CONFIRM message has been eliminated and replaced with
  2878.       implicit confirmation provided by the KEEPALIVE message.
  2879.  
  2880.       5.  The format of the UPDATE message has been changed
  2881.       significantly.  New fields were added to the UPDATE message to
  2882.       support multiple path attributes.
  2883.  
  2884.       6.  The Marker field has been expanded and its role broadened to
  2885.       support authentication.
  2886.  
  2887.       Note that quite often BGP, as specified in RFC 1105, is referred
  2888.       to as BGP-1, BGP, as specified in RFC 1163, is referred to as
  2889.       BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and
  2890.       BGP, as specified in this document is referred to as BGP-4.
  2891.  
  2892.  
  2893. Appendix 5.  TCP options that may be used with BGP
  2894.  
  2895.  
  2896.    If a local system TCP user interface supports TCP PUSH function, then
  2897.    each BGP message should be transmitted with PUSH flag set.  Setting
  2898.    PUSH flag forces BGP messages to be transmitted promptly to the
  2899.    receiver.
  2900.  
  2901.    If a local system TCP user interface supports setting precedence for
  2902.    TCP connection, then the BGP transport connection should be opened
  2903.    with precedence set to Internetwork Control (110) value (see also
  2904.  
  2905.  
  2906.  
  2907. Expiration Date October 1993                                   [Page 52]
  2908.  
  2909. INTERNET DRAFT                                                April 1993
  2910.  
  2911.  
  2912.    [6]).
  2913.  
  2914.  
  2915.  
  2916. Appendix 6.  Implementation Recommendations
  2917.  
  2918.  
  2919.       This section presents some implementation recommendations.
  2920.  
  2921.  
  2922. 6.1 Multiple Networks Per Message
  2923.  
  2924.  
  2925.    The BGP protocol allows for multiple networks with the same AS path
  2926.    and next-hop gateway to be specified in one message. Making use of
  2927.    this capability is highly recommended. With one network per message
  2928.    there is a substantial increase in overhead in the receiver. Not only
  2929.    does the system overhead increase due to the reception of multiple
  2930.    messages, but the overhead of scanning the routing table for updates
  2931.    to BGP peers and other routing protocols (and sending the associated
  2932.    messages) is incurred multiple times as well. One method of building
  2933.    messages containing many networks per AS path and gateway from a
  2934.    routing table that is not organized per AS path is to build many
  2935.    messages as the routing table is scanned. As each network is
  2936.    processed, a message for the associated AS path and gateway is
  2937.    allocated, if it does not exist, and the new network is added to it.
  2938.    If such a message exists, the new network is just appended to it. If
  2939.    the message lacks the space to hold the new network, it is
  2940.    transmitted, a new message is allocated, and the new network is
  2941.    inserted into the new message. When the entire routing table has been
  2942.    scanned, all allocated messages are sent and their resources
  2943.    released.  Maximum compression is achieved when all networks share a
  2944.    gateway and common path attributes, making it possible to send many
  2945.    networks in one 4096-byte message.
  2946.  
  2947.    When peering with a BGP implementation that does not compress
  2948.    multiple networks into one message, it may be necessary to take steps
  2949.    to reduce the overhead from the flood of data received when a peer is
  2950.    acquired or a significant network topology change occurs. One method
  2951.    of doing this is to limit the rate of updates. This will eliminate
  2952.    the redundant scanning of the routing table to provide flash updates
  2953.    for BGP peers and other routing protocols. A disadvantage of this
  2954.    approach is that it increases the propagation latency of routing
  2955.    information.  By choosing a minimum flash update interval that is not
  2956.    much greater than the time it takes to process the multiple messages
  2957.    this latency should be minimized. A better method would be to read
  2958.    all received messages before sending updates.
  2959.  
  2960.  
  2961.  
  2962.  
  2963. Expiration Date October 1993                                   [Page 53]
  2964.  
  2965. INTERNET DRAFT                                                April 1993
  2966.  
  2967.  
  2968. 6.2  Processing Messages on a Stream Protocol
  2969.  
  2970.  
  2971.    BGP uses TCP as a transport mechanism.  Due to the stream nature of
  2972.    TCP, all the data for received messages does not necessarily arrive
  2973.    at the same time. This can make it difficult to process the data as
  2974.    messages, especially on systems such as BSD Unix where it is not
  2975.    possible to determine how much data has been received but not yet
  2976.    processed.
  2977.  
  2978.    One method that can be used in this situation is to first try to read
  2979.    just the message header. For the KEEPALIVE message type, this is a
  2980.    complete message; for other message types, the header should first be
  2981.    verified, in particular the total length. If all checks are
  2982.    successful, the specified length, minus the size of the message
  2983.    header is the amount of data left to read. An implementation that
  2984.    would "hang" the routing information process while trying to read
  2985.    from a peer could set up a message buffer (4096 bytes) per peer and
  2986.    fill it with data as available until a complete message has been
  2987.    received.
  2988.  
  2989.  
  2990. 6.3 Reducing route flapping
  2991.  
  2992.  
  2993.    To avoid excessive route flapping a BGP speaker which needs to
  2994.    withdraw a destination and send an update about a more specific or
  2995.    less specific route shall combine them into the same UPDATE message.
  2996.  
  2997.  
  2998. 6.4 BGP Timers
  2999.  
  3000.  
  3001.    BGP employs five timers: ConnectRetry, Holdtime, KeepAlive,
  3002.    MinRouteOriginationInterval, and MinRouteAdvertisementInterval
  3003.    Suggested value for the ConnectRetry timer is 120 seconds.  Suggested
  3004.    value for the Holdtime timer is 90 seconds.  Suggested value for the
  3005.    KeepAlive timer is 30 seconds.  Suggested value for the
  3006.    MinRouteOriginationInterval is 15 minutes.  Suggested value for the
  3007.    MinRouteAdvertisementInterval is 30 seconds.
  3008.  
  3009.    An implementation of BGP shall allow any of these timers to be
  3010.    configurable.
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019. Expiration Date October 1993                                   [Page 54]
  3020.  
  3021. INTERNET DRAFT                                                April 1993
  3022.  
  3023.  
  3024. 6.5 Path attribute ordering
  3025.  
  3026.  
  3027.    Implementations which combine update messages as described above in
  3028.    6.1 may prefer to see all path attributes presented in a known order.
  3029.    This permits them to quickly identify sets of attributes from
  3030.    different update messages which are semantically identical.  To
  3031.    facilitate this, it is a useful optimization to order the path
  3032.    attributes according to type code.  This optimization is entirely
  3033.    optional.
  3034.  
  3035.  
  3036. 6.6 AS_SET sorting
  3037.  
  3038.  
  3039.    Another useful optimization that can be done to simplify this
  3040.    situation is to sort the AS numbers found in an AS_SET.  This
  3041.    optimization is entirely optional.
  3042.  
  3043.  
  3044. 6.7 Control over version negotiation
  3045.  
  3046.  
  3047.    Since BGP-4 is capable of carrying aggregated routes which cannot be
  3048.    properly represented in BGP-3, an implementation which supports BGP-4
  3049.    and another BGP version should provide the capability to only speak
  3050.    BGP-4 on a per-neighbor basis.
  3051.  
  3052.  
  3053. 6.8 Complex AS_PATH aggregation
  3054.  
  3055.  
  3056.    An implementation which chooses to provide a path aggregation
  3057.    algorithm which retains significant amounts of path information may
  3058.    wish to use the following procedure:
  3059.  
  3060.       For the purpose of aggregating AS_PATH attributes of two routes,
  3061.       we model each AS as a tuple <type, value>, where "type" identifies
  3062.       a type of the path segment the AS belongs to (e.g.  AS_SEQUENCE,
  3063.       AS_SET), and "value" is the AS number.  Two ASs are said to be the
  3064.       same if their corresponding <type, value> tuples are the same.
  3065.  
  3066.       The algorithm to aggregate two AS_PATH attributes works as
  3067.       follows:
  3068.  
  3069.          a) Identify the same ASs (as defined above) within each AS_PATH
  3070.          attribute that are in the same relative order within both
  3071.          AS_PATH attributes.  Two ASs, X and Y, are said to be in the
  3072.  
  3073.  
  3074.  
  3075. Expiration Date October 1993                                   [Page 55]
  3076.  
  3077. INTERNET DRAFT                                                April 1993
  3078.  
  3079.  
  3080.          same order if either:
  3081.             - X precedes Y in both AS_PATH attributes, or - Y precedes X
  3082.             in both AS_PATH attributes.
  3083.  
  3084.          b) The aggregated AS_PATH attribute consists of ASs identified
  3085.          in (a) in exactly the same order as they appear in the AS_PATH
  3086.          attributes to be aggregated. If two consecutive ASs identified
  3087.          in (a) do not immediately follow each other in both of the
  3088.          AS_PATH attributes to be aggregated, then the intervening ASs
  3089.          (ASs that are between the two consecutive ASs that are the
  3090.          same) in both attributes are combined into an AS_SET path
  3091.          segment that consists of the intervening ASs from both AS_PATH
  3092.          attributes; this segment is then placed in between the two
  3093.          consecutive ASs identified in (a) of the aggregated attribute.
  3094.          If two consecutive ASs identified in (a) immediately follow
  3095.          each other in one attribute, but do not follow in another, then
  3096.          the intervening ASs of the latter are combined into an AS_SET
  3097.          path segment; this segment is then placed in between the two
  3098.          consecutive ASs identified in (a) of the aggregated attribute.
  3099.  
  3100.  
  3101.       If as a result of the above procedure a given AS number appears
  3102.       more than once within the aggregated AS_PATH attribute, all, but
  3103.       the last instance (rightmost occurrence) of that AS number should
  3104.       be removed from the aggregated AS_PATH attribute.
  3105.  
  3106. References
  3107.  
  3108.  
  3109.    [1] Mills, D., "Exterior Gateway Protocol Formal Specification", RFC
  3110.    904, BBN, April 1984.
  3111.  
  3112.    [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET
  3113.    Backbone", RFC 1092, T.J. Watson Research Center, February 1989.
  3114.  
  3115.    [3] Braun, H-W., "The NSFNET Routing Architecture", RFC 1093,
  3116.    MERIT/NSFNET Project, February 1989.
  3117.  
  3118.    [4] Postel, J., "Transmission Control Protocol - DARPA Internet
  3119.    Program Protocol Specification", RFC 793, DARPA, September 1981.
  3120.  
  3121.    [5] Rekhter, Y., and P. Gross, "Application of the Border Gateway
  3122.    Protocol in the Internet", RFC 1268, T.J. Watson Research Center, IBM
  3123.    Corp., ANS, October 1991.
  3124.  
  3125.    [6] Postel, J., "Internet Protocol - DARPA Internet Program Protocol
  3126.    Specification", RFC 791, DARPA, September 1981.
  3127.  
  3128.  
  3129.  
  3130.  
  3131. Expiration Date October 1993                                   [Page 56]
  3132.  
  3133. INTERNET DRAFT                                                April 1993
  3134.  
  3135.  
  3136.    [7] "Information Processing Systems - Telecommunications and
  3137.    Information Exchange between Systems - Protocol for Exchange of
  3138.    Inter-domain Routeing Information among Intermediate Systems to
  3139.    Support Forwarding of ISO 8473 PDUs", ISO/IEC JTC 1/SC 6 N7196, March
  3140.    1992.
  3141.  
  3142.    [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., "Supernetting: an
  3143.    Address Assignment and Aggregation Strategy", Internet Draft, 1992.
  3144.  
  3145.  
  3146. Security Considerations
  3147.  
  3148.    Security issues are not discussed in this memo.
  3149.  
  3150.  
  3151. Editors' Addresses
  3152.  
  3153.    Yakov Rekhter
  3154.    T.J. Watson Research Center IBM Corporation
  3155.    P.O. Box 218
  3156.    Yorktown Heights, NY 10598
  3157.    Phone:  (914) 945-3896
  3158.    email:  yakov@watson.ibm.com
  3159.  
  3160.    Tony Li
  3161.    cisco Systems, Inc.
  3162.    1525 O'Brien Drive
  3163.    Menlo Park, CA 94025
  3164.    email: tli@cisco.com
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187. Expiration Date October 1993                                   [Page 57]
  3188.  
  3189.